aboutsummaryrefslogtreecommitdiff
path: root/src/disk.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-02-17 20:40:59 -0500
committerKevin O'Connor <kevin@koconnor.net>2009-02-17 20:40:59 -0500
commit5c0c4b7d083d5d6bee924e78ed102857f6a93d71 (patch)
treea47f9af2e5c8b8a5bbb13678517475b73bf90d85 /src/disk.c
parent7da1dcd03e3fc3a187c7222178a220fcb074b055 (diff)
downloadseabios-hppa-5c0c4b7d083d5d6bee924e78ed102857f6a93d71.zip
seabios-hppa-5c0c4b7d083d5d6bee924e78ed102857f6a93d71.tar.gz
seabios-hppa-5c0c4b7d083d5d6bee924e78ed102857f6a93d71.tar.bz2
Bug fix - cdrom media emulation only moves drives if of the same type.
The bug caused floppies to move when hard drive emulation was in effect, and vice-versa. This patch fixes it.
Diffstat (limited to 'src/disk.c')
-rw-r--r--src/disk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/disk.c b/src/disk.c
index dfaa24f..9bad1d7 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -697,11 +697,12 @@ handle_13(struct bregs *regs)
}
u16 ebda_seg = get_ebda_seg();
if (GET_EBDA2(ebda_seg, cdemu.active)) {
- if (drive == GET_EBDA2(ebda_seg, cdemu.emulated_drive)) {
+ u8 emudrive = GET_EBDA2(ebda_seg, cdemu.emulated_drive);
+ if (drive == emudrive) {
cdemu_13(regs);
return;
}
- if (drive < 0xe0)
+ if (drive < 0xe0 && ((emudrive ^ drive) & 0x80) == 0)
drive--;
}
}