--- src/sercon.c | 11 ++++++++++- src/romlayout.S | 12 +++++++----- 2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/sercon.c b/src/sercon.c index 9c49a2fc4c..7d38afb816 100644 --- a/src/sercon.c +++ b/src/sercon.c @@ -313,11 +313,20 @@ static void sercon_1000(struct bregs *regs)
if (!sercon_splitmode()) { switch (mode) { + case 0x00: + case 0x01: + cols = 40; + rows = 25; + regs->al = 0x30; + break; + case 0x02: case 0x03: + case 0x07: default: cols = 80; rows = 25; regs->al = 0x30; + break; } cursor_pos_set(0, 0); SET_BDA(video_mode, mode); @@ -328,7 +337,7 @@ static void sercon_1000(struct bregs *regs) /* let vgabios handle mode init */ }
- SET_LOW(sercon_enable, (mode == 0x03)); + SET_LOW(sercon_enable, (mode <= 0x03) || (mode == 0x07)); SET_LOW(sercon_col_last, 0); SET_LOW(sercon_row_last, 0); SET_LOW(sercon_attr_last, 0); diff --git a/src/romlayout.S b/src/romlayout.S index 911a416d7f..2ef857103e 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -434,7 +434,7 @@ entry_sercon: pushl $1f retl 1: cmpl %esp, %eax - jne 4f + jne 5f cmpb $0, sercon_enable // Test that sercon is enabled je 3f
@@ -449,15 +449,17 @@ entry_sercon:
// sercon disabled - verify not 0x03 modeset and otherwise exit 3: popl %eax + cmpw $0x0007, %ax + je 4f cmpw $0x0003, %ax - jne 5f - pushl %eax + jg 6f +4: pushl %eax jmp 2b
// Running on broken x86emu - restore stack and exit -4: movl %eax, %esp +5: movl %eax, %esp popl %eax -5: popw %ds +6: popw %ds iretw