update config, CHANGELOG and timestamp

This commit is contained in:
Wengier 2022-07-10 17:51:31 -04:00
parent 4cdf58c3d9
commit 2df03f10f9
12 changed files with 145 additions and 75 deletions

View File

@ -5,17 +5,32 @@
systems. A config option "convertdrivefat" (in
[dosbox] section) is added to toggle this setting,
or you can toggle via BOOT command's -convertfat
and -noconvertfat options. There is also a config
option "drive z convert fat" (in [dos] section)
to control if to convert virtual drive Z:. Much of
the code is imported from DOSBox Pure. (Wengier)
(or -convertfatro option for read-only access) and
-noconvertfat options. There is also a config
option "drive z convert fat" (in [dos] section) to
control whether to convert virtual drive Z:. Much
of the code is imported from DOSBox Pure. (Wengier)
- Added config option to allow create of temporary
devices for piping operations when a temporary DOS
path is not available. (Wengier)
- Added support for ATAPI raw sector reading with
READ CD command. (schellingb)
- Report bad sectors recorded in raw CD images as
ATAPI read errors. (schellingb)
- Fixed display of individual/total file sizes with
DIR command when they are very large. (Wengier)
- Fixed DBCS code page conversions for mounted FAT
- Fixed non-US code page conversions for mounted FAT
drives. (Wengier)
- Fixed possible "Path not found" bug when switching
to code page 950 from another code page. (Wengier)
- Fixed creating directories may not work properly
for overlay drives on Windows systems. (Wengier)
- Fixed -set and -get options of CONFIG command when
there are spaces in property names, without having
to prepend the section names. For example, command
CONFIG -get "synchronize time" is supported just
as CONFIG -get "dosbox synchronize time". Similar
for -SET option when launching DOSBox-X. (Wengier)
0.84.1
- Added dosbox(-x).conf option to enable workaround
for errant DOS programs that set the TF (trap flag)

View File

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

View File

@ -1,4 +1,4 @@
/*auto-generated*/
#define UPDATED_STR "Jul 9, 2022 9:36:37pm"
#define GIT_COMMIT_HASH "0da7bef"
#define UPDATED_STR "Jul 11, 2022 6:20:51pm"
#define GIT_COMMIT_HASH "a4bdbf8"
#define COPYRIGHT_END_YEAR "2022"

View File

@ -89,7 +89,7 @@ HANDLE hFind = INVALID_HANDLE_VALUE;
DBCS_upcase(sfn);
name = sfn;
}
if (name.empty() && !uselfn) continue;
if (name.empty()) name = "?";
}
date = DOS_PackDate(lt.wYear,lt.wMonth,lt.wDay);
time = DOS_PackTime(lt.wHour,lt.wMinute,lt.wSecond);
@ -143,7 +143,7 @@ HANDLE hFind = INVALID_HANDLE_VALUE;
DBCS_upcase(sfn);
name = sfn;
}
if (name.empty() && !uselfn) continue;
if (name.empty()) name = "?";
}
date = DOS_PackDate(lt.wYear,lt.wMonth,lt.wDay);
time = DOS_PackTime(lt.wHour,lt.wMinute,lt.wSecond);

View File

@ -102,11 +102,12 @@ bool qmount = false;
bool nowarn = false;
bool CodePageHostToGuestUTF8(char *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/), CodePageHostToGuestUTF16(char *d/*CROSS_LEN*/,const uint16_t *s/*CROSS_LEN*/);
extern bool systemmessagebox(char const * aTitle, char const * aMessage, char const * aDialogType, char const * aIconType, int aDefaultButton);
extern bool addovl, addipx, addne2k, prepared, inshell, usecon, uao, morelen, mountfro[26], mountiro[26], resetcolor, staycolors, printfont, internal_program;
extern bool clear_screen(), OpenGL_using(void), DOS_SetAnsiAttr(uint8_t attr);
extern bool addovl, addipx, addne2k, prepared, inshell, usecon, chinasea, uao, morelen, mountfro[26], mountiro[26], resetcolor, staycolors, printfont, internal_program;
extern bool clear_screen(), OpenGL_using(void), DOS_SetAnsiAttr(uint8_t attr), isDBCSCP();
extern int lastcp, FileDirExistCP(const char *name), FileDirExistUTF8(std::string &localname, const char *name);
extern uint8_t DOS_GetAnsiAttr(void);
void DOS_EnableDriveMenu(char drv), GFX_SetTitle(int32_t cycles, int frameskip, Bits timing, bool paused), UpdateSDLDrawTexture();
void MSG_Init(), JFONT_Init(), InitFontHandle(), ShutFontHandle(), DOSBox_SetSysMenu(), makestdcp950table(), makeseacp951table();
void DOS_EnableDriveMenu(char drv), GFX_SetTitle(int32_t cycles, int frameskip, Bits timing, bool paused), UpdateSDLDrawTexture(), toSetCodePage(DOS_Shell *shell, int newCP, int opt);
void runBoot(const char *str), runMount(const char *str), runImgmount(const char *str), runRescan(const char *str), show_prompt(), ttf_reset(void);
void getdrivezpath(std::string &path, std::string dirname), drivezRegister(std::string path, std::string dir, bool usecp), UpdateDefaultPrinterFont(void);
std::string GetDOSBoxXPath(bool withexe=false);
@ -1294,26 +1295,37 @@ public:
if (cp==932||cp==936||cp==949||cp==950||cp==951)
#endif
{
if (cp == 950 && !chinasea) makestdcp950table();
if (cp == 951 && chinasea) makeseacp951table();
cpbak = dos.loaded_codepage;
dos.loaded_codepage = cp;
host_name = CodePageGuestToHost(temp_line.c_str());
char str[150];
sprintf(str, "Drive %c: appears to require code page %d in order to be accessed.\n\nDo you want to change the current code page to %d now?\n", drive, cp, cp);
sprintf(str, "Drive %c: appears to require code page %d to be accessed.\n\nDo you want to change the current code page to %d now?\n", drive, cp, cp);
if (!host_name || ht_stat(host_name, &htest) || _waccess(host_name,0) || !systemmessagebox("Changing code page",str,"yesno","question",1))
dos.loaded_codepage = cpbak;
#if defined(USE_TTF)
else if (ttf.inUse&&(cp==932||cp==936||cp==949||cp==950||cp==951)) {
Section_prop * ttf_section = static_cast<Section_prop *>(control->GetSection("ttf"));
const char *font = ttf_section->Get_string("font");
if (!font || !*font) {
ttf_reset();
#if C_PRINTER
if (printfont) UpdateDefaultPrinterFont();
#endif
}
else if (ttf.inUse) {
dos.loaded_codepage = cpbak;
toSetCodePage(NULL, cp, -1);
}
#endif
else {
MSG_Init();
DOSBox_SetSysMenu();
if (isDBCSCP()) {
ShutFontHandle();
InitFontHandle();
JFONT_Init();
}
SetupDBCSTable();
runRescan("-A -Q");
#if C_OPENGL && DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW
if (OpenGL_using() && control->opt_lang.size() && lastcp && lastcp != dos.loaded_codepage)
UpdateSDLDrawTexture();
#endif
}
}
}
#elif defined (OS2)
@ -2507,7 +2519,7 @@ public:
char msg[512] = {0};
const uint8_t page=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
if ((convimg == 1 || (convertimg && convimg == -1 && !IS_PC98_ARCH))) { // PC-98 image not supported yet
if (!dos_kernel_disabled && (convimg == 1 || (convertimg && convimg == -1 && !IS_PC98_ARCH))) { // PC-98 image not supported yet
unsigned int drv = 2, nextdrv = 2;
for (unsigned int d=2;d<DOS_DRIVES+2;d++) {
if (d==DOS_DRIVES) drv=0;
@ -6359,8 +6371,6 @@ void runImgmount(const char *str) {
Bitu DOS_SwitchKeyboardLayout(const char* new_layout, int32_t& tried_cp);
Bitu DOS_LoadKeyboardLayout(const char * layoutname, int32_t codepage, const char * codepagefile);
void MSG_Init(), JFONT_Init(), InitFontHandle(), ShutFontHandle(), DOSBox_SetSysMenu();
bool isDBCSCP();
const char* DOS_GetLoadedLayout(void);
class KEYB : public Program {
@ -6381,12 +6391,20 @@ void KEYB::Run(void) {
cmd->FindCommand(2,cp_string);
int tocp=!strcmp(temp_line.c_str(), "jp")?932:(!strcmp(temp_line.c_str(), "ko")?949:(!strcmp(temp_line.c_str(), "tw")||!strcmp(temp_line.c_str(), "hk")||!strcmp(temp_line.c_str(), "zht")||(!strcmp(temp_line.c_str(), "zh")&&((cp_string.size()&&(atoi(cp_string.c_str())==950||atoi(cp_string.c_str())==951))||(!cp_string.size()&&(dos.loaded_codepage==950||dos.loaded_codepage==951))))?((cp_string.size()&&atoi(cp_string.c_str())==951)||(!cp_string.size()&&dos.loaded_codepage==951)?951:950):(!strcmp(temp_line.c_str(), "cn")||!strcmp(temp_line.c_str(), "zhs")||!strcmp(temp_line.c_str(), "zh")?936:0)));
if (tocp && !IS_PC98_ARCH) {
uint16_t cpbak = dos.loaded_codepage;
dos.loaded_codepage=tocp;
const char* layout_name = DOS_GetLoadedLayout();
if (layout_name==NULL)
WriteOut(MSG_Get("PROGRAM_KEYB_INFO"),dos.loaded_codepage);
else
WriteOut(MSG_Get("PROGRAM_KEYB_INFO_LAYOUT"),dos.loaded_codepage,layout_name);
#if defined(USE_TTF)
if (ttf.inUse) {
dos.loaded_codepage = cpbak;
toSetCodePage(NULL, tocp, -1);
} else
#endif
{
MSG_Init();
DOSBox_SetSysMenu();
if (isDBCSCP()) {
@ -6400,6 +6418,7 @@ void KEYB::Run(void) {
if (OpenGL_using() && control->opt_lang.size() && lastcp && lastcp != dos.loaded_codepage)
UpdateSDLDrawTexture();
#endif
}
return;
}
if (cp_string.size()) {

View File

@ -27,14 +27,14 @@
#include "render.h"
#include <assert.h>
extern bool gbk;
extern int maxfcb;
extern bool gbk, chinasea;
extern Bitu DOS_PRIVATE_SEGMENT_Size;
#if defined(USE_TTF)
extern bool ttf_dosv;
#endif
void CALLBACK_DeAllocate(Bitu in);
void CALLBACK_DeAllocate(Bitu in), makestdcp950table(), makeseacp951table();
std::list<DOS_GetMemLog_Entry> DOS_GetMemLog;
@ -216,6 +216,8 @@ PhysPt DOS_Get_DPB(unsigned int dos_drive) {
}
void SetupDBCSTable() {
if (dos.loaded_codepage==950&&!chinasea) makestdcp950table();
else if (dos.loaded_codepage==951&&chinasea) makeseacp951table();
if (enable_dbcs_tables) {
if (!dos.tables.dbcs) dos.tables.dbcs=RealMake(DOS_GetMemory(12,"dos.tables.dbcs"),0);

View File

@ -2480,29 +2480,29 @@ nextfile:
unsigned int stridx = oidx * 13u, len = 0;
uint16_t lchar = 0;
char lname[27] = {0};
for (unsigned int i=0;i < 5;i++) {
lchar = (uint16_t)(dlfn->LDIR_Name1[i]);
if (lchar < 0x100 || lchar == 0xFFFF)
lname[len++] = (char)(lchar & 0xFF);
else {
char text[10];
uint16_t uname[4];
for (unsigned int i=0;i < 5;i++) {
text[0] = text[1] = text[2] = 0;
lchar = (uint16_t)(dlfn->LDIR_Name1[i]);
if (lchar < 0x100 || lchar == 0xFFFF)
lname[len++] = lchar != 0xFFFF && CodePageHostToGuestUTF16(text,&lchar) && text[0] && !text[1] ? text[0] : (char)(lchar & 0xFF);
else {
uname[0]=lchar;
uname[1]=0;
text[0] = 0;
text[1] = 0;
text[2] = 0;
if (CodePageHostToGuestUTF16(text,uname)) {
lname[len++] = (char)(text[0] & 0xFF);
lname[len++] = (char)(text[1] & 0xFF);
}
} else
lname[len++] = '_';
}
}
for (unsigned int i=0;i < 6;i++) {
text[0] = text[1] = text[2] = 0;
lchar = (uint16_t)(dlfn->LDIR_Name2[i]);
if (lchar < 0x100 || lchar == 0xFFFF)
lname[len++] = (char)(lchar & 0xFF);
lname[len++] = lchar != 0xFFFF && CodePageHostToGuestUTF16(text,&lchar) && text[0] && !text[1] ? text[0] : (char)(lchar & 0xFF);
else {
char text[10];
uint16_t uname[4];
@ -2514,13 +2514,15 @@ nextfile:
if (CodePageHostToGuestUTF16(text,uname)) {
lname[len++] = (char)(text[0] & 0xFF);
lname[len++] = (char)(text[1] & 0xFF);
}
} else
lname[len++] = '_';
}
}
for (unsigned int i=0;i < 2;i++) {
text[0] = text[1] = text[2] = 0;
lchar = (uint16_t)(dlfn->LDIR_Name3[i]);
if (lchar < 0x100 || lchar == 0xFFFF)
lname[len++] = (char)(lchar & 0xFF);
lname[len++] = lchar != 0xFFFF && CodePageHostToGuestUTF16(text,&lchar) && text[0] && !text[1] ? text[0] : (char)(lchar & 0xFF);
else {
char text[10];
uint16_t uname[4];
@ -2532,10 +2534,8 @@ nextfile:
if (CodePageHostToGuestUTF16(text,uname)) {
lname[len++] = (char)(text[0] & 0xFF);
lname[len++] = (char)(text[1] & 0xFF);
} else {
lname[len++] = (char)(lchar / 0x100);
lname[len++] = (char)(lchar % 0x100);
}
} else
lname[len++] = '_';
}
}
lname[len] = 0;
@ -2770,11 +2770,11 @@ bool fatDrive::addDirectoryEntry(uint32_t dirClustNumber, const direntry& useEnt
if (lfn != NULL && *lfn != 0) {
/* 13 characters per LFN entry */
bool lead = false;
char text[3];
uint16_t uname[4];
for (const char *scan = lfn; *scan; scan++) {
if (lead) {
lead = false;
char text[3];
uint16_t uname[4];
text[0]=*(scan-1)&0xFF;
text[1]=*scan&0xFF;
text[2]=0;
@ -2787,7 +2787,12 @@ bool fatDrive::addDirectoryEntry(uint32_t dirClustNumber, const direntry& useEnt
if (len < LFN_NAMELENGTH) lfnw[len++] = *scan&0xFF;
}
} else if (*(scan+1) && ((IS_PC98_ARCH && shiftjis_lead_byte(*scan&0xFF)) || (isDBCSCP() && isKanji1_gbk(*scan&0xFF)))) lead = true;
else lfnw[len++] = (uint16_t)((unsigned char)(*scan));
else if (dos.loaded_codepage != 437) {
text[0]=*scan&0xFF;
text[1]=0;
lfnw[len++] = CodePageGuestToHostUTF16(uname,text)&&uname[0]!=0&&uname[1]==0 ? uname[0] : (uint16_t)((unsigned char)(*scan));
} else
lfnw[len++] = (uint16_t)((unsigned char)(*scan));
}
lfnw[len] = 0;
need = (unsigned int)(1 + (len + 12) / 13); /*round up*/;

View File

@ -8152,21 +8152,26 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
if (!strlen(pvars[0].c_str())) continue;
if (pvars[0][0]=='%'||pvars[0][0]=='\0'||pvars[0][0]=='#'||pvars[0][0]=='\n') continue;
Section* sec = control->GetSectionFromProperty(pvars[0].c_str());
// attempt to split off the first word
std::string::size_type spcpos = pvars[0].find_first_of(' ');
if (spcpos>1&&pvars[0].c_str()[spcpos-1]==',')
spcpos=pvars[0].find_first_of(' ', spcpos+1);
std::string::size_type equpos = pvars[0].find_first_of('=');
if (equpos != std::string::npos) {
std::string p = pvars[0];
p.erase(equpos);
sec = control->GetSectionFromProperty(p.c_str());
}
if ((equpos != std::string::npos) &&
((spcpos == std::string::npos) || (equpos < spcpos))) {
((spcpos == std::string::npos) || (equpos < spcpos) || sec)) {
// If we have a '=' possibly before a ' ' split on the =
pvars.insert(pvars.begin()+1,pvars[0].substr(equpos+1));
pvars[0].erase(equpos);
// As we had a = the first thing must be a property now
Section* sec=control->GetSectionFromProperty(pvars[0].c_str());
sec=control->GetSectionFromProperty(pvars[0].c_str());
if (!sec&&pvars[0].size()>4&&!strcasecmp(pvars[0].substr(0, 4).c_str(), "ttf.")) {
pvars[0].erase(0,4);
sec = control->GetSectionFromProperty(pvars[0].c_str());
@ -8184,7 +8189,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
pvars[0].erase(spcpos);
}
// check if the first parameter is a section or property
Section* sec = control->GetSection(pvars[0].c_str());
sec = control->GetSection(pvars[0].c_str());
if (!sec) {
// not a section: little duplicate from above
sec=control->GetSectionFromProperty(pvars[0].c_str());
@ -8211,7 +8216,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
if (!sec2) {
// not a property,
Section* sec3 = control->GetSectionFromProperty(pvars[0].c_str());
if (sec3) {
if (sec3 && !(equpos != std::string::npos && spcpos != std::string::npos && equpos > spcpos)) {
// section and property name are identical
pvars.insert(pvars.begin(),pvars[0]);
} // else has been checked above already

View File

@ -397,11 +397,11 @@ struct fatFromDOSDrive
size_t len = 0, lfnlen = strlen(lname);
uint16_t *lfnw = (uint16_t *)malloc((lfnlen + 1) * sizeof(uint16_t));
if (lfnw == NULL) continue;
char text[3];
uint16_t uname[4];
for (size_t i=0; i < lfnlen; i++) {
if (lead) {
lead = false;
char text[3];
uint16_t uname[4];
text[0]=lname[i-1]&0xFF;
text[1]=lname[i]&0xFF;
text[2]=0;
@ -414,7 +414,12 @@ struct fatFromDOSDrive
lfnw[len++] = lname[i];
}
} else if (i+1<lfnlen && ((IS_PC98_ARCH && shiftjis_lead_byte(lname[i]&0xFF)) || (isDBCSCP() && isKanji1_gbk(lname[i]&0xFF)))) lead = true;
else lfnw[len++] = lname[i];
else if (dos.loaded_codepage != 437) {
text[0]=lname[i]&0xFF;
text[1]=0;
lfnw[len++] = CodePageGuestToHostUTF16(uname,text)&&uname[0]!=0&&uname[1]==0 ? uname[0] : lname[i];
} else
lfnw[len++] = lname[i];
}
uint16_t *lfn_end = lfnw + len;
for (size_t i = 0, lfnblocks = (len + 12) / 13; i != lfnblocks; i++)

View File

@ -1488,9 +1488,10 @@ void CONFIG::Run(void) {
WriteOut(MSG_Get("PROGRAM_CONFIG_GET_SYNTAX"));
return;
}
Section* sec = control->GetSectionFromProperty(pvars[0].c_str());
std::string::size_type spcpos = pvars[0].find_first_of(' ');
// split on the ' '
if (spcpos != std::string::npos) {
if (!sec && spcpos != std::string::npos) {
if (spcpos>1&&pvars[0].c_str()[spcpos-1]==',')
spcpos=pvars[0].find_first_of(' ', spcpos+1);
if (spcpos != std::string::npos) {
@ -1502,7 +1503,7 @@ void CONFIG::Run(void) {
case 1: {
// property/section only
// is it a section?
Section* sec = control->GetSection(pvars[0].c_str());
sec = control->GetSection(pvars[0].c_str());
if (sec) {
// list properties in section
int i = 0;
@ -1725,7 +1726,7 @@ void CONFIG::Run(void) {
}
case 2: {
// section + property
Section* sec = control->GetSection(pvars[0].c_str());
sec = control->GetSection(pvars[0].c_str());
if (!sec) {
WriteOut(MSG_Get("PROGRAM_CONFIG_SECTION_ERROR"), pvars[0].c_str());
return;
@ -1797,20 +1798,26 @@ void CONFIG::Run(void) {
std::string rest;
if (cmd->GetStringRemain(rest)) pvars.push_back(rest);
Section* sec = control->GetSectionFromProperty(pvars[0].c_str());
// attempt to split off the first word
std::string::size_type spcpos = pvars[0].find_first_of(' ');
if (spcpos>1&&pvars[0].c_str()[spcpos-1]==',')
spcpos=pvars[0].find_first_of(' ', spcpos+1);
std::string::size_type equpos = pvars[0].find_first_of('=');
if (equpos != std::string::npos) {
std::string p = pvars[0];
p.erase(equpos);
sec = control->GetSectionFromProperty(p.c_str());
}
if ((equpos != std::string::npos) &&
((spcpos == std::string::npos) || (equpos < spcpos))) {
((spcpos == std::string::npos) || (equpos < spcpos) || sec)) {
// If we have a '=' possibly before a ' ' split on the =
pvars.insert(pvars.begin()+1,pvars[0].substr(equpos+1));
pvars[0].erase(equpos);
// As we had a = the first thing must be a property now
Section* sec=control->GetSectionFromProperty(pvars[0].c_str());
sec=control->GetSectionFromProperty(pvars[0].c_str());
if (!sec&&pvars[0].size()>4&&!strcasecmp(pvars[0].substr(0, 4).c_str(), "ttf.")) {
pvars[0].erase(0,4);
sec = control->GetSectionFromProperty(pvars[0].c_str());
@ -1828,7 +1835,7 @@ void CONFIG::Run(void) {
pvars[0].erase(spcpos);
}
// check if the first parameter is a section or property
Section* sec = control->GetSection(pvars[0].c_str());
sec = control->GetSection(pvars[0].c_str());
if (!sec) {
// not a section: little duplicate from above
sec=control->GetSectionFromProperty(pvars[0].c_str());
@ -1855,7 +1862,7 @@ void CONFIG::Run(void) {
if (!sec2) {
// not a property,
Section* sec3 = control->GetSectionFromProperty(pvars[0].c_str());
if (sec3) {
if (sec3 && !(equpos != std::string::npos && spcpos != std::string::npos && equpos > spcpos)) {
// section and property name are identical
pvars.insert(pvars.begin(),pvars[0]);
} // else has been checked above already

View File

@ -123,7 +123,7 @@ static bool blinkstate = false;
bool colorChanged = false, justChanged = false, staycolors = false, firstsize = true, ttfswitch=false, switch_output_from_ttf=false;
int menuwidth_atleast(int width), FileDirExistCP(const char *name), FileDirExistUTF8(std::string &localname, const char *name);
void AdjustIMEFontSize(void), initcodepagefont(void), change_output(int output), drawmenu(Bitu val), MSG_Init(void), KEYBOARD_Clear(void), RENDER_Reset(void), DOSBox_SetSysMenu(void), GetMaxWidthHeight(unsigned int *pmaxWidth, unsigned int *pmaxHeight), SetWindowTransparency(int trans), resetFontSize(void), RENDER_CallBack( GFX_CallBackFunctions_t function );
void AdjustIMEFontSize(void), initcodepagefont(void), change_output(int output), drawmenu(Bitu val), KEYBOARD_Clear(void), RENDER_Reset(void), DOSBox_SetSysMenu(void), GetMaxWidthHeight(unsigned int *pmaxWidth, unsigned int *pmaxHeight), SetWindowTransparency(int trans), resetFontSize(void), RENDER_CallBack( GFX_CallBackFunctions_t function );
bool isDBCSCP(void), InitCodePage(void), CodePageGuestToHostUTF16(uint16_t *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/), systemmessagebox(char const * aTitle, char const * aMessage, char const * aDialogType, char const * aIconType, int aDefaultButton);
std::string GetDOSBoxXPath(bool withexe=false);

View File

@ -4424,7 +4424,7 @@ void toSetCodePage(DOS_Shell *shell, int newCP, int opt) {
#endif
DOSBox_SetSysMenu();
}
if (opt<1) {
if (opt<1 && shell) {
shell->WriteOut(MSG_Get("SHELL_CMD_CHCP_ACTIVE"), dos.loaded_codepage);
#if defined(USE_TTF)
if (missing > 0) shell->WriteOut(MSG_Get("SHELL_CMD_CHCP_MISSING"), missing);
@ -4437,7 +4437,19 @@ void toSetCodePage(DOS_Shell *shell, int newCP, int opt) {
}
SetupDBCSTable();
runRescan("-A -Q");
} else if (opt<1)
#if defined(USE_TTF)
if (opt==-1&&(newCP==932||newCP==936||newCP==949||newCP==950||newCP==951)) {
Section_prop * ttf_section = static_cast<Section_prop *>(control->GetSection("ttf"));
const char *font = ttf_section->Get_string("font");
if (!font || !*font) {
ttf_reset();
#if C_PRINTER
if (printfont) UpdateDefaultPrinterFont();
#endif
}
}
#endif
} else if (opt<1 && shell)
shell->WriteOut(MSG_Get("SHELL_CMD_CHCP_INVALID"), std::to_string(newCP).c_str());
}