Skip to content

Commit

Permalink
Switch off TTF mode in text modes not working in TTF mode
Browse files Browse the repository at this point in the history
  • Loading branch information
maron2000 committed Jan 13, 2025
1 parent c90ceef commit 25006e7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ints/int10_modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ static bool SetCurMode(VideoModeBlock modeblock[],uint16_t mode) {
if ((!int10.vesa_oldvbe) || (ModeList_VGA[i].mode<0x120)) {
CurMode=&modeblock[i];
#if defined(USE_TTF)
if(modeblock[i].type == M_TEXT) ttf_switch_on(false);
else ttf_switch_off(false); // Disable TTF output when switching to graphics mode
ttf_switch_off(false); // Disable TTF output when switching to graphics mode,
// however for text mode, temporary switched off and switched on again later to avoid glitches
#endif
return true;
}
Expand Down Expand Up @@ -866,7 +866,8 @@ static void FinishSetMode(bool clearmem) {
/* Setup the BIOS */
if (CurMode->mode<128) real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE,(uint8_t)CurMode->mode);
else real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE,(uint8_t)(CurMode->mode-0x98)); //Looks like the s3 bios
#if defined(USE_TTF)
#if 0
//#if defined(USE_TTF)
if (TTF_using() && CurMode->type==M_TEXT) {
if (ttf.inUse) {
ttf.cols = (int)CurMode->twidth;
Expand Down Expand Up @@ -919,6 +920,12 @@ static void FinishSetMode(bool clearmem) {
int10.text_row = real_readb(BIOSMEM_SEG, BIOSMEM_NB_ROWS);
/* FIXME */
VGA_DAC_UpdateColorPalette();
#if defined(USE_TTF)
//LOG_MSG("INT10: type=%d, mode=%d, twidth=%d, theight=%d", CurMode->type, CurMode->mode, CurMode->twidth, CurMode->theight);
if(CurMode->type == M_TEXT) { // FIX_ME: Text mode detection when screen mode is not changed via INT 10h function
ttf_switch_on(); // TTF mode is switched on in text mode only.
}
#endif
}

uint8_t TandyGetCRTPage(void) {
Expand Down

0 comments on commit 25006e7

Please sign in to comment.