mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-09 03:41:10 +08:00
A more universal fix for glitch of DBCS character at the end of a line
This commit is contained in:
parent
38b86b3f6a
commit
a7d740fd7a
@ -106,7 +106,7 @@ public:
|
|||||||
bool EraseEnv(void);
|
bool EraseEnv(void);
|
||||||
virtual void WriteOut(const char *format, const char * arguments);
|
virtual void WriteOut(const char *format, const char * arguments);
|
||||||
void WriteOut(const char * format,...); //! Write to standard output
|
void WriteOut(const char * format,...); //! Write to standard output
|
||||||
virtual int WriteOut_NoParsing(const char * format, bool dbcs = true); //! Write to standard output, no parsing
|
virtual int WriteOut_NoParsing(const char * format, bool dbcs = false); //! Write to standard output, no parsing
|
||||||
void ChangeToLongCmd(); //! Get command line from shell instead of PSP
|
void ChangeToLongCmd(); //! Get command line from shell instead of PSP
|
||||||
void DebugDumpEnv(); //! Dump environment block to log
|
void DebugDumpEnv(); //! Dump environment block to log
|
||||||
void WriteExitStatus(); //! Write exit status to CPU register AL for return to MS-DOS
|
void WriteExitStatus(); //! Write exit status to CPU register AL for return to MS-DOS
|
||||||
|
@ -1079,7 +1079,7 @@ bool device_CON::Write(const uint8_t * data,uint16_t * size) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Bitu i;
|
Bitu i;
|
||||||
uint8_t col,page;
|
uint8_t col,row,page;
|
||||||
|
|
||||||
INT10_SetCurMode();
|
INT10_SetCurMode();
|
||||||
|
|
||||||
@ -1110,6 +1110,19 @@ bool device_CON::Write(const uint8_t * data,uint16_t * size) {
|
|||||||
log_dev_con_str += (char)data[count];
|
log_dev_con_str += (char)data[count];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page = real_readb(BIOSMEM_SEG, BIOSMEM_CURRENT_PAGE);
|
||||||
|
col = CURSOR_POS_COL(page);
|
||||||
|
BIOS_NCOLS;
|
||||||
|
if(isDBCSCP() && !dos.direct_output && (col == ncols - 1) && isKanji1(data[count])) { // Consideration of first byte of DBCS characters at the end of line
|
||||||
|
BIOS_NROWS;
|
||||||
|
row = CURSOR_POS_ROW(page);
|
||||||
|
if(nrows == row + 1) {
|
||||||
|
INT10_ScrollWindow(0, 0, (uint8_t)(nrows - 1), (uint8_t)(ncols - 1), -1, ansi.attr, page);
|
||||||
|
INT10_SetCursorPos(row, 0, page);
|
||||||
|
}
|
||||||
|
else INT10_SetCursorPos(row+1, 0, page);
|
||||||
|
}
|
||||||
|
|
||||||
if (!ansi.esc){
|
if (!ansi.esc){
|
||||||
if(data[count]=='\033' && ansi.installed) {
|
if(data[count]=='\033' && ansi.installed) {
|
||||||
/*clear the datastructure */
|
/*clear the datastructure */
|
||||||
@ -1120,7 +1133,6 @@ bool device_CON::Write(const uint8_t * data,uint16_t * size) {
|
|||||||
continue;
|
continue;
|
||||||
} else if(data[count] == '\t' && !dos.direct_output) {
|
} else if(data[count] == '\t' && !dos.direct_output) {
|
||||||
/* expand tab if not direct output */
|
/* expand tab if not direct output */
|
||||||
page = real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
|
|
||||||
do {
|
do {
|
||||||
Output(' ');
|
Output(' ');
|
||||||
col=CURSOR_POS_COL(page);
|
col=CURSOR_POS_COL(page);
|
||||||
@ -1128,16 +1140,12 @@ bool device_CON::Write(const uint8_t * data,uint16_t * size) {
|
|||||||
count++;
|
count++;
|
||||||
continue;
|
continue;
|
||||||
} else if (data[count] == 0x1A && IS_PC98_ARCH) {
|
} else if (data[count] == 0x1A && IS_PC98_ARCH) {
|
||||||
page = real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
|
|
||||||
|
|
||||||
/* it also redraws the function key row */
|
/* it also redraws the function key row */
|
||||||
update_pc98_function_row(pc98_function_row_mode,true);
|
update_pc98_function_row(pc98_function_row_mode,true);
|
||||||
|
|
||||||
INT10_ScrollWindow(0,0,255,255,0,ansi.attr,page);
|
INT10_ScrollWindow(0,0,255,255,0,ansi.attr,page);
|
||||||
Real_INT10_SetCursorPos(0,0,page);
|
Real_INT10_SetCursorPos(0,0,page);
|
||||||
} else if (data[count] == 0x1E && IS_PC98_ARCH) {
|
} else if (data[count] == 0x1E && IS_PC98_ARCH) {
|
||||||
page = real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
|
|
||||||
|
|
||||||
Real_INT10_SetCursorPos(0,0,page);
|
Real_INT10_SetCursorPos(0,0,page);
|
||||||
} else {
|
} else {
|
||||||
Output(data[count]);
|
Output(data[count]);
|
||||||
@ -1631,7 +1639,7 @@ void device_CON::Output(uint8_t chr) {
|
|||||||
uint8_t page=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
|
uint8_t page=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
|
||||||
uint8_t col=CURSOR_POS_COL(page);
|
uint8_t col=CURSOR_POS_COL(page);
|
||||||
uint8_t row=CURSOR_POS_ROW(page);
|
uint8_t row=CURSOR_POS_ROW(page);
|
||||||
BIOS_NCOLS;BIOS_NROWS;
|
BIOS_NCOLS;BIOS_NROWS;
|
||||||
if (nrows==row+1 && (chr=='\n' || (ncols==col+1 && chr!='\r' && chr!=8 && chr!=7))) {
|
if (nrows==row+1 && (chr=='\n' || (ncols==col+1 && chr!='\r' && chr!=8 && chr!=7))) {
|
||||||
INT10_ScrollWindow(0,0,(uint8_t)(nrows-1),(uint8_t)(ncols-1),-1,ansi.attr,page);
|
INT10_ScrollWindow(0,0,(uint8_t)(nrows-1),(uint8_t)(ncols-1),-1,ansi.attr,page);
|
||||||
INT10_SetCursorPos(row-1,col,page);
|
INT10_SetCursorPos(row-1,col,page);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user