- the step delay for the recalibrate and seek commands is now calculated from the
number of steps to do, the step rate time and the date rate - the option floppy_command_delay is obsolete now, since all floppy delays are based on the hardware specs. The usage of this option caused a warning now.
This commit is contained in:
parent
3e00c16800
commit
e0f02463f9
@ -514,17 +514,6 @@ keyboard_serial_delay: 250
|
||||
#=======================================================================
|
||||
keyboard_paste_delay: 100000
|
||||
|
||||
#=======================================================================
|
||||
# FLOPPY_COMMAND_DELAY:
|
||||
# Time in microseconds to wait before completing some floppy commands
|
||||
# such as read/write/seek/etc, which normally have a delay associated.
|
||||
# I had this hardwired to 50,000 before.
|
||||
#
|
||||
# Examples:
|
||||
# floppy_command_delay: 50000
|
||||
#=======================================================================
|
||||
floppy_command_delay: 500
|
||||
|
||||
#=======================================================================
|
||||
# MOUSE:
|
||||
# This option prevents Bochs from creating mouse "events" unless a mouse
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: bochs.h,v 1.161 2005-10-28 00:12:26 kevinlawton Exp $
|
||||
// $Id: bochs.h,v 1.162 2005-11-12 10:38:51 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -641,7 +641,6 @@ typedef struct BOCHSAPI {
|
||||
bx_param_num_c *Okeyboard_serial_delay;
|
||||
bx_param_num_c *Okeyboard_paste_delay;
|
||||
bx_param_enum_c *Okeyboard_type;
|
||||
bx_param_num_c *Ofloppy_command_delay;
|
||||
bx_param_num_c *Oips;
|
||||
bx_param_bool_c *Orealtime_pit;
|
||||
bx_param_bool_c *Otext_snapshot_check;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: config.cc,v 1.57 2005-11-07 19:06:05 vruppert Exp $
|
||||
// $Id: config.cc,v 1.58 2005-11-12 10:38:51 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -1623,11 +1623,6 @@ void bx_init_options ()
|
||||
100000);
|
||||
bx_options.Okeyboard_paste_delay->set_handler (bx_param_handler);
|
||||
bx_options.Okeyboard_paste_delay->set_runtime_param (1);
|
||||
bx_options.Ofloppy_command_delay = new bx_param_num_c (BXP_FLOPPY_CMD_DELAY,
|
||||
"Floppy command delay",
|
||||
"Time in microseconds to wait before completing some floppy commands such as read/write/seek/etc, which normally have a delay associated. This used to be hardwired to 50,000 before.",
|
||||
1, BX_MAX_BIT32U,
|
||||
500);
|
||||
bx_options.cmosimage.Oenabled = new bx_param_bool_c (BXP_CMOSIMAGE_ENABLED,
|
||||
"Use a CMOS image",
|
||||
"Controls the usage of a CMOS image",
|
||||
@ -1693,7 +1688,6 @@ void bx_init_options ()
|
||||
menu->get_options ()->set (menu->SHOW_PARENT);
|
||||
|
||||
bx_param_c *other_init_list[] = {
|
||||
bx_options.Ofloppy_command_delay,
|
||||
bx_options.cmosimage.Oenabled,
|
||||
bx_options.cmosimage.Opath,
|
||||
bx_options.cmosimage.Ortc_init,
|
||||
@ -1713,7 +1707,6 @@ void bx_init_options ()
|
||||
bx_options.log.Oprefix,
|
||||
bx_options.Omouse_enabled,
|
||||
bx_options.Omouse_type,
|
||||
bx_options.Ofloppy_command_delay,
|
||||
bx_options.Oprivate_colormap,
|
||||
#if BX_WITH_AMIGAOS
|
||||
bx_options.Ofullscreen,
|
||||
@ -1879,7 +1872,6 @@ void bx_reset_options ()
|
||||
bx_options.clock.Osync->reset();
|
||||
|
||||
// other
|
||||
bx_options.Ofloppy_command_delay->reset();
|
||||
bx_options.Oi440FXSupport->reset();
|
||||
bx_options.cmosimage.Oenabled->reset();
|
||||
bx_options.cmosimage.Opath->reset();
|
||||
@ -2751,13 +2743,7 @@ parse_line_formatted(char *context, int num_params, char *params[])
|
||||
PARSE_ERR (("%s: keyboard_paste_delay not big enough!", context));
|
||||
}
|
||||
} else if (!strcmp(params[0], "floppy_command_delay")) {
|
||||
if (num_params != 2) {
|
||||
PARSE_ERR(("%s: floppy_command_delay directive: wrong # args.", context));
|
||||
}
|
||||
bx_options.Ofloppy_command_delay->set (atol(params[1]));
|
||||
if (bx_options.Ofloppy_command_delay->get () < 100) {
|
||||
PARSE_ERR(("%s: floppy_command_delay not big enough!", context));
|
||||
}
|
||||
PARSE_WARN(("%s: floppy_command_delay is deprecated (now using hardware timing).", context));
|
||||
} else if (!strcmp(params[0], "ips")) {
|
||||
if (num_params != 2) {
|
||||
PARSE_ERR(("%s: ips directive: wrong # args.", context));
|
||||
@ -3690,7 +3676,6 @@ bx_write_configuration (char *rc, int overwrite)
|
||||
fprintf (fp, "vga: extension=%s\n", bx_options.Ovga_extension->getptr ());
|
||||
fprintf (fp, "keyboard_serial_delay: %u\n", bx_options.Okeyboard_serial_delay->get ());
|
||||
fprintf (fp, "keyboard_paste_delay: %u\n", bx_options.Okeyboard_paste_delay->get ());
|
||||
fprintf (fp, "floppy_command_delay: %u\n", bx_options.Ofloppy_command_delay->get ());
|
||||
fprintf (fp, "ips: %u\n", bx_options.Oips->get ());
|
||||
fprintf (fp, "text_snapshot_check: %d\n", bx_options.Otext_snapshot_check->get ());
|
||||
fprintf (fp, "mouse: enabled=%d\n", bx_options.Omouse_enabled->get ());
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
================================================================
|
||||
doc/docbook/user/user.dbk
|
||||
$Id: user.dbk,v 1.186 2005-10-23 07:16:59 vruppert Exp $
|
||||
$Id: user.dbk,v 1.187 2005-11-12 10:38:51 vruppert Exp $
|
||||
|
||||
This is the top level file for the Bochs Users Manual.
|
||||
================================================================
|
||||
@ -3716,18 +3716,6 @@ consistently in Windows.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section><title>floppy_command_delay</title>
|
||||
<para>
|
||||
Examples:
|
||||
<screen>
|
||||
floppy_command_delay: 50000
|
||||
</screen>
|
||||
Time in microseconds to wait before completing some floppy commands such as
|
||||
read, write, seek, etc., which normally have a delay associated. This
|
||||
was once hardwired to 50000 but now you can adjust it.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section id="bochsopt-ips"><title>ips</title>
|
||||
<para>
|
||||
Examples:
|
||||
@ -8273,7 +8261,6 @@ debug: action=ignore
|
||||
vga_update_interval: 300000
|
||||
keyboard_serial_delay: 250
|
||||
keyboard_paste_delay: 100000
|
||||
floppy_command_delay: 500
|
||||
ips: 1000000
|
||||
mouse: enabled=0
|
||||
private_colormap: enabled=0
|
||||
@ -8588,7 +8575,6 @@ Setup your <filename>bochsrc</filename> file. For example:
|
||||
log: ./bochs.out
|
||||
vga_update_interval: 300000
|
||||
keyboard_serial_delay: 200
|
||||
floppy_command_delay: 500
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
@ -10497,7 +10483,6 @@ floppy_bootsig_check: disabled=0
|
||||
vga_update_interval: 300000
|
||||
keyboard_serial_delay: 250
|
||||
keyboard_paste_delay: 100000
|
||||
floppy_command_delay: 500
|
||||
ips: 3000000
|
||||
clock: sync=realtime, time0=0
|
||||
text_snapshot_check: 0
|
||||
|
@ -522,17 +522,6 @@ delay until it stops losing characters.
|
||||
Example:
|
||||
keyboard_paste_delay: 100000
|
||||
|
||||
.TP
|
||||
.I "floppy_command_delay:"
|
||||
Time in microseconds to wait before completing
|
||||
some floppy commands such as read, write,
|
||||
seek, etc., which normally have a delay
|
||||
associated. This was previous hardwired to
|
||||
50,000.
|
||||
|
||||
Example:
|
||||
floppy_command_delay: 50000
|
||||
|
||||
.TP
|
||||
.I "ips:"
|
||||
Emulated Instructions Per Second. This is the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: siminterface.h,v 1.147 2005-11-07 19:06:05 vruppert Exp $
|
||||
// $Id: siminterface.h,v 1.148 2005-11-12 10:38:51 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Intro to siminterface by Bryce Denney:
|
||||
@ -152,7 +152,6 @@ typedef enum {
|
||||
BXP_KBD_SERIAL_DELAY,
|
||||
BXP_KBD_PASTE_DELAY,
|
||||
BXP_KBD_TYPE,
|
||||
BXP_FLOPPY_CMD_DELAY,
|
||||
BXP_FLOPPYA_DEVTYPE,
|
||||
BXP_FLOPPYA_PATH,
|
||||
BXP_FLOPPYA_TYPE,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: floppy.cc,v 1.86 2005-11-10 18:56:45 vruppert Exp $
|
||||
// $Id: floppy.cc,v 1.87 2005-11-12 10:38:51 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -97,6 +97,10 @@ static floppy_type_t floppy_type[8] = {
|
||||
{BX_FLOPPY_2_88, 80, 2, 36, 5760}
|
||||
};
|
||||
|
||||
static Bit16u drate_in_k[4] = {
|
||||
500, 300, 250, 1000
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
libfloppy_LTX_plugin_init(plugin_t *plugin, plugintype_t type, int argc, char *argv[])
|
||||
@ -132,7 +136,7 @@ bx_floppy_ctrl_c::init(void)
|
||||
{
|
||||
Bit8u i;
|
||||
|
||||
BX_DEBUG(("Init $Id: floppy.cc,v 1.86 2005-11-10 18:56:45 vruppert Exp $"));
|
||||
BX_DEBUG(("Init $Id: floppy.cc,v 1.87 2005-11-12 10:38:51 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++) {
|
||||
@ -293,19 +297,14 @@ bx_floppy_ctrl_c::init(void)
|
||||
if (BX_FD_THIS s.num_supported_floppies > 0) {
|
||||
DEV_cmos_set_reg(0x14, (DEV_cmos_get_reg(0x14) & 0x3e) |
|
||||
((BX_FD_THIS s.num_supported_floppies-1) << 6) | 1);
|
||||
}
|
||||
else
|
||||
} else {
|
||||
DEV_cmos_set_reg(0x14, (DEV_cmos_get_reg(0x14) & 0x3e));
|
||||
|
||||
}
|
||||
|
||||
if (BX_FD_THIS s.floppy_timer_index == BX_NULL_TIMER_HANDLE) {
|
||||
BX_FD_THIS s.floppy_timer_index =
|
||||
bx_pc_system.register_timer( this, timer_handler,
|
||||
bx_options.Ofloppy_command_delay->get (), 0,0, "floppy");
|
||||
bx_pc_system.register_timer( this, timer_handler, 250, 0, 0, "floppy");
|
||||
}
|
||||
|
||||
BX_DEBUG(("bx_options.Ofloppy_command_delay = %u",
|
||||
(unsigned) bx_options.Ofloppy_command_delay->get ()));
|
||||
}
|
||||
|
||||
|
||||
@ -338,6 +337,7 @@ bx_floppy_ctrl_c::reset(unsigned type)
|
||||
}
|
||||
BX_FD_THIS s.data_rate = 0; /* 500 Kbps */
|
||||
BX_FD_THIS s.non_dma = 0;
|
||||
BX_FD_THIS s.SRT = 0;
|
||||
} else {
|
||||
BX_INFO(("controller reset in software"));
|
||||
}
|
||||
@ -346,7 +346,7 @@ bx_floppy_ctrl_c::reset(unsigned type)
|
||||
BX_FD_THIS s.cylinder[i] = 0;
|
||||
BX_FD_THIS s.head[i] = 0;
|
||||
BX_FD_THIS s.sector[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
DEV_pic_lower_irq(6);
|
||||
DEV_dma_set_drq(FLOPPY_DMA_CHAN, 0);
|
||||
@ -656,13 +656,12 @@ bx_floppy_ctrl_c::floppy_command(void)
|
||||
" external environment"));
|
||||
#else
|
||||
unsigned i, no_cl_reset = 0;
|
||||
Bit8u step_rate_time;
|
||||
Bit8u head_unload_time;
|
||||
Bit8u head_load_time;
|
||||
Bit8u motor_on;
|
||||
Bit8u head, drive, cylinder, sector, eot;
|
||||
Bit8u sector_size, data_length;
|
||||
Bit32u logical_sector, sector_time;
|
||||
Bit32u logical_sector, sector_time, step_delay;
|
||||
|
||||
// on hardware I checked, the FDC does not reset the change line on some commands (ben lunt)
|
||||
if ((BX_FD_THIS s.command[0] == 0x04) || (BX_FD_THIS s.command[0] == 0x4A)) no_cl_reset = 1;
|
||||
@ -685,7 +684,7 @@ bx_floppy_ctrl_c::floppy_command(void)
|
||||
case 0x03: // specify
|
||||
// execution: specified parameters are loaded
|
||||
// result: no result bytes, no interrupt
|
||||
step_rate_time = BX_FD_THIS s.command[1] >> 4;
|
||||
BX_FD_THIS s.SRT = BX_FD_THIS s.command[1] >> 4;
|
||||
head_unload_time = BX_FD_THIS s.command[1] & 0x0f;
|
||||
head_load_time = BX_FD_THIS s.command[2] >> 1;
|
||||
BX_FD_THIS s.non_dma = BX_FD_THIS s.command[2] & 0x01;
|
||||
@ -720,8 +719,8 @@ bx_floppy_ctrl_c::floppy_command(void)
|
||||
BX_FD_THIS s.DOR |= 0x10; // turn on MOTA
|
||||
else
|
||||
BX_FD_THIS s.DOR |= 0x20; // turn on MOTB
|
||||
bx_pc_system.activate_timer(BX_FD_THIS s.floppy_timer_index,
|
||||
bx_options.Ofloppy_command_delay->get (), 0);
|
||||
step_delay = calculate_step_delay(drive, 0);
|
||||
bx_pc_system.activate_timer(BX_FD_THIS s.floppy_timer_index, step_delay, 0);
|
||||
/* command head to track 0
|
||||
* controller set to non-busy
|
||||
* error condition noted in Status reg 0's equipment check bit
|
||||
@ -769,10 +768,10 @@ bx_floppy_ctrl_c::floppy_command(void)
|
||||
BX_FD_THIS s.DOR |= drive;
|
||||
|
||||
BX_FD_THIS s.head[drive] = (BX_FD_THIS s.command[1] >> 2) & 0x01;
|
||||
BX_FD_THIS s.cylinder[drive] = BX_FD_THIS s.command[2];
|
||||
step_delay = calculate_step_delay(drive, BX_FD_THIS s.command[2]);
|
||||
bx_pc_system.activate_timer(BX_FD_THIS s.floppy_timer_index, step_delay, 0);
|
||||
/* ??? should also check cylinder validity */
|
||||
bx_pc_system.activate_timer(BX_FD_THIS s.floppy_timer_index,
|
||||
bx_options.Ofloppy_command_delay->get (), 0);
|
||||
BX_FD_THIS s.cylinder[drive] = BX_FD_THIS s.command[2];
|
||||
/* data reg not ready, drive busy */
|
||||
BX_FD_THIS s.main_status_reg = (1 << drive);
|
||||
return;
|
||||
@ -1778,3 +1777,16 @@ bx_floppy_ctrl_c::enter_idle_phase(void)
|
||||
BX_FD_THIS s.floppy_buffer_index = 0;
|
||||
}
|
||||
|
||||
Bit32u bx_floppy_ctrl_c::calculate_step_delay(Bit8u drive, Bit8u new_cylinder)
|
||||
{
|
||||
Bit8u steps;
|
||||
Bit32u one_step_delay;
|
||||
|
||||
if (new_cylinder == BX_FD_THIS s.cylinder[drive]) {
|
||||
steps = 1;
|
||||
} else {
|
||||
steps = abs(new_cylinder - BX_FD_THIS s.cylinder[drive]);
|
||||
}
|
||||
one_step_delay = ((BX_FD_THIS s.SRT ^ 0x0f) + 1) * 500000 / drate_in_k[BX_FD_THIS s.data_rate];
|
||||
return (steps * one_step_delay);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: floppy.h,v 1.22 2005-11-10 18:56:45 vruppert Exp $
|
||||
// $Id: floppy.h,v 1.23 2005-11-12 10:38:51 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -121,8 +121,9 @@ private:
|
||||
// b7: 0=diskette is present and has not been changed
|
||||
// 1=diskette missing or changed
|
||||
bx_bool non_dma;
|
||||
Bit8u SRT; // step rate time
|
||||
int statusbar_id[2]; // IDs of the status LEDs
|
||||
} s; // state information
|
||||
} s; // state information
|
||||
|
||||
static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
|
||||
static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
|
||||
@ -138,6 +139,7 @@ private:
|
||||
BX_FD_SMF void lower_interrupt(void);
|
||||
BX_FD_SMF void enter_idle_phase(void);
|
||||
BX_FD_SMF void enter_result_phase(void);
|
||||
BX_FD_SMF Bit32u calculate_step_delay(Bit8u drive, Bit8u new_cylinder);
|
||||
static void timer_handler(void *);
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user