- DEV_set_media_status() not necessary in gui floppy handlers when using the

win32 floppy dialog
- report geometry with BX_INFO after inserting new floppy media
This commit is contained in:
Volker Ruppert 2003-12-18 20:04:49 +00:00
parent 623ba8b00d
commit f731c1774c
2 changed files with 11 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: gui.cc,v 1.72 2003-07-18 15:51:02 vruppert Exp $
// $Id: gui.cc,v 1.73 2003-12-18 20:04:48 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -221,11 +221,6 @@ bx_gui_c::floppyA_handler(void)
// a dialog asking what disk image you want to switch to.
int ret = SIM->ask_param (BXP_FLOPPYA_PATH);
if (ret > 0) {
// eject and then insert the disk. If the new path is invalid,
// the status will return 0.
unsigned new_status = DEV_floppy_set_media_status(0, 0);
new_status = DEV_floppy_set_media_status(0, 1);
BX_GUI_THIS floppyA_status = new_status;
BX_GUI_THIS update_drive_status_buttons ();
}
return;
@ -248,11 +243,6 @@ bx_gui_c::floppyB_handler(void)
// a dialog asking what disk image you want to switch to.
int ret = SIM->ask_param (BXP_FLOPPYB_PATH);
if (ret > 0) {
// eject and then insert the disk. If the new path is invalid,
// the status will return 0.
unsigned new_status = DEV_floppy_set_media_status(1, 0);
new_status = DEV_floppy_set_media_status(1, 1);
BX_GUI_THIS floppyB_status = new_status;
BX_GUI_THIS update_drive_status_buttons ();
}
return;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: floppy.cc,v 1.68 2003-12-10 22:14:01 vruppert Exp $
// $Id: floppy.cc,v 1.69 2003-12-18 20:04:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -132,7 +132,7 @@ bx_floppy_ctrl_c::init(void)
{
Bit8u i;
BX_DEBUG(("Init $Id: floppy.cc,v 1.68 2003-12-10 22:14:01 vruppert Exp $"));
BX_DEBUG(("Init $Id: floppy.cc,v 1.69 2003-12-18 20:04:49 vruppert Exp $"));
DEV_dma_register_8bit_channel(2, dma_read, dma_write, "Floppy Drive");
DEV_register_irq(6, "Floppy Drive");
for (unsigned addr=0x03F2; addr<=0x03F7; addr++) {
@ -1320,8 +1320,16 @@ bx_floppy_ctrl_c::set_media_status(unsigned drive, unsigned status)
if (evaluate_media(type, path, & BX_FD_THIS s.media[drive])) {
BX_FD_THIS s.media_present[drive] = 1;
if (drive == 0) {
#define MED (BX_FD_THIS s.media[0])
BX_INFO(("fd0: '%s' ro=%d, h=%d,t=%d,spt=%d", bx_options.floppya.Opath->getptr(),
MED.write_protected, MED.heads, MED.tracks, MED.sectors_per_track));
#undef MED
bx_options.floppya.Ostatus->set(BX_INSERTED);
} else {
#define MED (BX_FD_THIS s.media[1])
BX_INFO(("fd1: '%s' ro=%d, h=%d,t=%d,spt=%d", bx_options.floppyb.Opath->getptr(),
MED.write_protected, MED.heads, MED.tracks, MED.sectors_per_track));
#undef MED
bx_options.floppyb.Ostatus->set(BX_INSERTED);
}
BX_FD_THIS s.DIR[drive] |= 0x80; // disk changed line