summaryrefslogtreecommitdiff
path: root/src/mouse.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-05-13 22:58:08 -0400
committerKevin O'Connor <kevin@koconnor.net>2012-05-20 18:11:09 -0400
commit4bc49979b94c03561d263bfd53014279d87d690f (patch)
treee2ed553c600c2d7dec92b3fd68d1de212833e520 /src/mouse.c
parentd314083a4172224f97567fb50741a4d43de3d191 (diff)
downloadqemu-seabios-4bc49979b94c03561d263bfd53014279d87d690f.tar.gz
EBDA cleanups.
Clean up includes of biosvar.h. Rename GET/SET_EBDA2 to GET/SET_EBDA - nearly all users use the extended form now anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/mouse.c')
-rw-r--r--src/mouse.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/mouse.c b/src/mouse.c
index e26cf69..237c8ff 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -52,7 +52,8 @@ mouse_15c20000(struct bregs *regs)
static void
mouse_15c20001(struct bregs *regs)
{
- u8 mouse_flags_2 = GET_EBDA(mouse_flag2);
+ u16 ebda_seg = get_ebda_seg();
+ u8 mouse_flags_2 = GET_EBDA(ebda_seg, mouse_flag2);
if ((mouse_flags_2 & 0x80) == 0) {
set_code_invalid(regs, RET_ENOHANDLER);
return;
@@ -158,8 +159,8 @@ mouse_15c205(struct bregs *regs)
return;
}
u16 ebda_seg = get_ebda_seg();
- SET_EBDA2(ebda_seg, mouse_flag1, 0x00);
- SET_EBDA2(ebda_seg, mouse_flag2, regs->bh);
+ SET_EBDA(ebda_seg, mouse_flag1, 0x00);
+ SET_EBDA(ebda_seg, mouse_flag2, regs->bh);
// Reset Mouse
mouse_15c201(regs);
@@ -227,7 +228,7 @@ mouse_15c207(struct bregs *regs)
{
struct segoff_s farptr = SEGOFF(regs->es, regs->bx);
u16 ebda_seg = get_ebda_seg();
- u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2);
+ u8 mouse_flags_2 = GET_EBDA(ebda_seg, mouse_flag2);
if (! farptr.segoff) {
/* remove handler */
if ((mouse_flags_2 & 0x80) != 0) {
@@ -238,8 +239,8 @@ mouse_15c207(struct bregs *regs)
/* install handler */
mouse_flags_2 |= 0x80;
}
- SET_EBDA2(ebda_seg, mouse_flag2, mouse_flags_2);
- SET_EBDA2(ebda_seg, far_call_pointer, farptr);
+ SET_EBDA(ebda_seg, mouse_flag2, mouse_flags_2);
+ SET_EBDA(ebda_seg, far_call_pointer, farptr);
set_code_success(regs);
}
@@ -279,8 +280,8 @@ process_mouse(u8 data)
return;
u16 ebda_seg = get_ebda_seg();
- u8 mouse_flags_1 = GET_EBDA2(ebda_seg, mouse_flag1);
- u8 mouse_flags_2 = GET_EBDA2(ebda_seg, mouse_flag2);
+ u8 mouse_flags_1 = GET_EBDA(ebda_seg, mouse_flag1);
+ u8 mouse_flags_2 = GET_EBDA(ebda_seg, mouse_flag2);
if (! (mouse_flags_2 & 0x80))
// far call handler not installed
@@ -288,20 +289,20 @@ process_mouse(u8 data)
u8 package_count = mouse_flags_2 & 0x07;
u8 index = mouse_flags_1 & 0x07;
- SET_EBDA2(ebda_seg, mouse_data[index], data);
+ SET_EBDA(ebda_seg, mouse_data[index], data);
if ((index+1) < package_count) {
mouse_flags_1++;
- SET_EBDA2(ebda_seg, mouse_flag1, mouse_flags_1);
+ SET_EBDA(ebda_seg, mouse_flag1, mouse_flags_1);
return;
}
- u16 status = GET_EBDA2(ebda_seg, mouse_data[0]);
- u16 X = GET_EBDA2(ebda_seg, mouse_data[1]);
- u16 Y = GET_EBDA2(ebda_seg, mouse_data[2]);
- SET_EBDA2(ebda_seg, mouse_flag1, 0);
+ u16 status = GET_EBDA(ebda_seg, mouse_data[0]);
+ u16 X = GET_EBDA(ebda_seg, mouse_data[1]);
+ u16 Y = GET_EBDA(ebda_seg, mouse_data[2]);
+ SET_EBDA(ebda_seg, mouse_flag1, 0);
- struct segoff_s func = GET_EBDA2(ebda_seg, far_call_pointer);
+ struct segoff_s func = GET_EBDA(ebda_seg, far_call_pointer);
dprintf(16, "mouse farcall s=%04x x=%04x y=%04x func=%04x:%04x\n"
, status, X, Y, func.seg, func.offset);