Fix lins and cols options were ignored

This commit is contained in:
maron2000 2025-02-11 20:09:46 +09:00
parent e82bbcfee8
commit ba311ccfce

View File

@ -87,6 +87,8 @@ void makestdcp950table(), makeseacp951table();
#if defined(USE_TTF)
void ttf_switch_on(bool ss = true), ttf_switch_off(bool ss = true);
void ttf_setlines(int cols, int lins);
void ttf_reset();
#endif
extern VideoModeBlock* CurMode;
@ -827,6 +829,14 @@ void showWelcome(Program *shell) {
bool finish_prepare = false;
void DOS_Shell::Prepare(void) {
if (this == first_shell) {
#if defined(USE_TTF)
if(CurMode->type == M_TEXT) ttf_switch_on(true); // Initialization completed, M_TEXT modes can switch to TTF mode from now on.
if(ttf.inUse) {
int cols = static_cast<Section_prop*>(control->GetSection("ttf"))->Get_int("cols");
int lins = static_cast<Section_prop*>(control->GetSection("ttf"))->Get_int("lins");
if(cols || lins) ttf_setlines(cols, lins);
}
#endif
const char* layoutname = DOS_GetLoadedLayout();
if(layoutname == NULL) {
int32_t cp = dos.loaded_codepage;
@ -834,9 +844,9 @@ void DOS_Shell::Prepare(void) {
toSetCodePage(NULL, cp, -1);
}
Section_prop *section = static_cast<Section_prop *>(control->GetSection("dosbox"));
if (section->Get_bool("startbanner")&&!control->opt_fastlaunch)
showWelcome(this);
else if ((CurMode->type==M_TEXT || IS_PC98_ARCH) && ANSI_SYS_installed())
if(section->Get_bool("startbanner") && !control->opt_fastlaunch)
showWelcome(NULL);
else if((CurMode->type == M_TEXT || IS_PC98_ARCH) && ANSI_SYS_installed())
WriteOut("\033[2J");
if (!countryNo) {
#if defined(WIN32)
@ -890,7 +900,6 @@ void DOS_Shell::Prepare(void) {
}
if(!chinasea)makestdcp950table();
if(chinasea) makeseacp951table();
runRescan("-A -Q");
const char * extra = section->data.c_str();
if (extra&&!control->opt_securemode&&!control->SecureMode()&&!control->opt_noconfig) {
std::string vstr;
@ -954,6 +963,8 @@ void DOS_Shell::Prepare(void) {
strcat(config_data, section->Get_string("rem"));
strcat(config_data, "\r\n");
}
if(dos.loaded_codepage == 932) toSetCodePage(this, 932, -1); // Workaround for corrupted box-drawing characters
runRescan("-A -Q");
internal_program = true;
VFILE_Register("AUTOEXEC.BAT",(uint8_t *)autoexec_data,(uint32_t)strlen(autoexec_data));
VFILE_Register("CONFIG.SYS",(uint8_t *)config_data,(uint32_t)strlen(config_data));
@ -988,9 +999,6 @@ void DOS_Shell::Prepare(void) {
//initcodepagefont();
//dos.loaded_codepage=cp;
finish_prepare = true;
#if defined(USE_TTF)
if(CurMode->type == M_TEXT) ttf_switch_on(true); // Initialization completed, M_TEXT modes can switch to TTF mode from now on.
#endif
}
#if (defined(WIN32) && !defined(HX_DOS) || defined(LINUX) && C_X11 || defined(MACOSX)) && (defined(C_SDL2) || defined(SDL_DOSBOX_X_SPECIAL))
if (enableime) SetIMPosition();