From 7feb9478302fc09aedb164d5b096dd4d0685cb05 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Mon, 15 Aug 2011 06:05:52 +0000 Subject: [PATCH] BIOS fixes --- bochs/CHANGES | 2 ++ bochs/bios/rombios.c | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/bochs/CHANGES b/bochs/CHANGES index f4472dc74..c3ddd26df 100644 --- a/bochs/CHANGES +++ b/bochs/CHANGES @@ -105,6 +105,7 @@ Bochs repository moved to the SVN version control ! - win32paramdlg: dialog size now adjusted to support larger label text - SF patches applied + [3370604] Ctrl-Break support for the bochs BIOS by Nikolay Nikolov [3302668] VMX preemption timer by Jianan Hao [3327510] Fix wrong address translation in debugger by Jianan Hao [3323758] Ctrl-Break support for the Win32 gui by Nikolay Nikolov @@ -120,6 +121,7 @@ Bochs repository moved to the SVN version control ! [3190995] add eth backend based on Slirp by Heikki Lindholm - these S.F. bugs were closed/fixed + [3062054] Problems with BIOS pointing device services (int 15h) [3277639] incompatible colours in palette [1788739] Abort on large memory setting [3012207] Int 13h FN 48h incorrect return values diff --git a/bochs/bios/rombios.c b/bochs/bios/rombios.c index a98ac3eea..382a65979 100644 --- a/bochs/bios/rombios.c +++ b/bochs/bios/rombios.c @@ -4257,7 +4257,7 @@ BX_DEBUG_INT15("case 1 or 5:\n"); return; } mouse_flags_2 = read_byte(ebda_seg, &EbdaData->mouse_flag2); - mouse_flags_2 = (mouse_flags_2 & 0x00) | regs.u.r8.bh; + mouse_flags_2 = (mouse_flags_2 & 0xF8) | regs.u.r8.bh; mouse_flags_1 = 0x00; write_byte(ebda_seg, &EbdaData->mouse_flag1, mouse_flags_1); write_byte(ebda_seg, &EbdaData->mouse_flag2, mouse_flags_2); @@ -5110,16 +5110,37 @@ int09_function(DI, SI, BP, SP, BX, DX, CX, AX) } break; - case 0x46: /* Scroll Lock press */ - mf2_flags |= 0x10; - write_byte(0x0040, 0x18, mf2_flags); - shift_flags ^= 0x10; - write_byte(0x0040, 0x17, shift_flags); + case 0x46: /* Scroll Lock or Ctrl-Break press */ + if ((mf2_state & 0x02) || (!(mf2_state & 0x10) && (shift_flags & 0x04))) { + /* Ctrl-Break press */ + mf2_state &= ~0x02; + write_byte(0x0040, 0x96, mf2_state); + write_byte(0x0040, 0x71, 0x80); + write_word(0x0040, 0x001C, read_word(0x0040, 0x001A)); + + ASM_START + int #0x1B + ASM_END + + enqueue_key(0, 0); + } else { + /* Scroll Lock press */ + mf2_flags |= 0x10; + write_byte(0x0040, 0x18, mf2_flags); + shift_flags ^= 0x10; + write_byte(0x0040, 0x17, shift_flags); + } break; - case 0xc6: /* Scroll Lock release */ - mf2_flags &= ~0x10; - write_byte(0x0040, 0x18, mf2_flags); + case 0xc6: /* Scroll Lock or Ctrl-Break release */ + if ((mf2_state & 0x02) || (!(mf2_state & 0x10) && (shift_flags & 0x04))) { + /* Ctrl-Break release */ + /* nothing to do */ + } else { + /* Scroll Lock release */ + mf2_flags &= ~0x10; + write_byte(0x0040, 0x18, mf2_flags); + } break; default: