(MESS) victor9k: Floppy WIP. (nw)

This commit is contained in:
Curt Coder 2014-11-03 22:00:22 +02:00
parent 841e3376cc
commit eee1cbdc5e
5 changed files with 103 additions and 72 deletions

View File

@ -23,18 +23,18 @@
Track format Track format
------------ ------------
ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL RPM
NUMBER TRACKS TRACKS PER TRACK PERIOD (MS) NUMBER TRACKS TRACKS PER TRACK PERIOD (MS)
0 0-3 unused 19 237.9 0 0-3 unused 19 237.9 252
1 4-15 0-7 18 224.5 1 4-15 0-7 18 224.5 267
2 16-26 8-18 17 212.2 2 16-26 8-18 17 212.2 283
3 27-37 19-29 16 199.9 3 27-37 19-29 16 199.9 300
4 38-48 30-40 15 187.6 4 38-48 30-40 15 187.6 320
5 49-59 41-51 14 175.3 5 49-59 41-51 14 175.3 342
6 60-70 52-62 13 163.0 6 60-70 52-62 13 163.0 368
7 71-79 63-74 12 149.6 7 71-79 63-74 12 149.6 401
8 unused 75-79 11 144.0 8 unused 75-79 11 144.0 417
*/ */
@ -77,10 +77,10 @@ bool victor9k_format::supports_save() const
const victor9k_format::format victor9k_format::formats[] = { const victor9k_format::format victor9k_format::formats[] = {
{ // { //
floppy_image::FF_525, floppy_image::SSDD, 80, 1, 256 floppy_image::FF_525, floppy_image::SSDD, 80, 1, 512
}, },
{ // { //
floppy_image::FF_525, floppy_image::DSDD, 80, 2, 256 floppy_image::FF_525, floppy_image::DSDD, 80, 2, 512
}, },
{} {}
}; };
@ -90,14 +90,52 @@ const UINT32 victor9k_format::cell_size[] =
0 0
}; };
const int victor9k_format::sectors_per_track[] = const int victor9k_format::sectors_per_track[2][80] =
{ {
0 {
19, 19, 19, 19,
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
12, 12, 12, 12, 12, 12, 12, 12, 12
},
{
18, 18, 18, 18, 18, 18, 18, 18,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
11, 11, 11, 11, 11
}
}; };
const int victor9k_format::speed_zone[] = const int victor9k_format::speed_zone[2][80] =
{ {
0 {
0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7
},
{
1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
8, 8, 8, 8, 8
}
}; };
const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator<victor9k_format>; const floppy_format_type FLOPPY_VICTOR_9000_FORMAT = &floppy_image_format_creator<victor9k_format>;

View File

@ -38,8 +38,8 @@ protected:
static const format formats[]; static const format formats[];
static const UINT32 cell_size[]; static const UINT32 cell_size[];
static const int sectors_per_track[]; static const int sectors_per_track[2][80];
static const int speed_zone[]; static const int speed_zone[2][80];
}; };
extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT; extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT;

View File

@ -509,6 +509,8 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state )
MCFG_DEVICE_ADD(FDC_TAG, VICTOR_9000_FDC, 0) MCFG_DEVICE_ADD(FDC_TAG, VICTOR_9000_FDC, 0)
MCFG_VICTOR_9000_FDC_IRQ_CB(WRITELINE(victor9k_state, fdc_irq_w)) MCFG_VICTOR_9000_FDC_IRQ_CB(WRITELINE(victor9k_state, fdc_irq_w))
MCFG_VICTOR_9000_FDC_SYN_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir0_w))
MCFG_VICTOR_9000_FDC_LBRDY_CB(INPUTLINE(I8088_TAG, INPUT_LINE_TEST))
// internal ram // internal ram
MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_ADD(RAM_TAG)

View File

@ -17,7 +17,6 @@
- spindle speed - spindle speed
- stepper - stepper
- read PLL - read PLL
- TACH0/1
- write logic - write logic
*/ */
@ -109,6 +108,11 @@ void victor_9000_fdc_t::unload0_cb(floppy_image_device *device)
m_via4->write_ca1(m_ds0); m_via4->write_ca1(m_ds0);
} }
void victor_9000_fdc_t::index0_cb(floppy_image_device *device, int state)
{
m_tach0 = state;
}
void victor_9000_fdc_t::ready1_cb(floppy_image_device *device, int state) void victor_9000_fdc_t::ready1_cb(floppy_image_device *device, int state)
{ {
m_rdy1 = state; m_rdy1 = state;
@ -132,8 +136,14 @@ void victor_9000_fdc_t::unload1_cb(floppy_image_device *device)
m_via4->write_cb1(m_ds1); m_via4->write_cb1(m_ds1);
} }
void victor_9000_fdc_t::index1_cb(floppy_image_device *device, int state)
{
m_tach1 = state;
}
static SLOT_INTERFACE_START( victor9k_floppies ) static SLOT_INTERFACE_START( victor9k_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD ) // Tandon TM100-3 with custom electronics
SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Tandon TM100-4 with custom electronics
SLOT_INTERFACE_END SLOT_INTERFACE_END
FLOPPY_FORMATS_MEMBER( victor_9000_fdc_t::floppy_formats ) FLOPPY_FORMATS_MEMBER( victor_9000_fdc_t::floppy_formats )
@ -246,9 +256,7 @@ victor_9000_fdc_t::victor_9000_fdc_t(const machine_config &mconfig, const char *
void victor_9000_fdc_t::device_start() void victor_9000_fdc_t::device_start()
{ {
// allocate timer // allocate timer
t_gen = timer_alloc(TM_GEN); t_gen = timer_alloc(0);
t_tach0 = timer_alloc(TM_TACH0);
t_tach1 = timer_alloc(TM_TACH1);
// state saving // state saving
save_item(NAME(m_da)); save_item(NAME(m_da));
@ -302,9 +310,11 @@ void victor_9000_fdc_t::device_reset()
m_floppy0->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready0_cb), this)); m_floppy0->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready0_cb), this));
m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this)); m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load0_cb), this));
m_floppy0->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload0_cb), this)); m_floppy0->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload0_cb), this));
m_floppy0->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(victor_9000_fdc_t::index0_cb), this));
m_floppy1->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready1_cb), this)); m_floppy1->setup_ready_cb(floppy_image_device::ready_cb(FUNC(victor_9000_fdc_t::ready1_cb), this));
m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this)); m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(victor_9000_fdc_t::load1_cb), this));
m_floppy1->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload1_cb), this)); m_floppy1->setup_unload_cb(floppy_image_device::unload_cb(FUNC(victor_9000_fdc_t::unload1_cb), this));
m_floppy1->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(victor_9000_fdc_t::index1_cb), this));
} }
@ -314,20 +324,8 @@ void victor_9000_fdc_t::device_reset()
void victor_9000_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void victor_9000_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
switch (id)
{
case TM_GEN:
live_sync(); live_sync();
live_run(); live_run();
case TM_TACH0:
// TODO
break;
case TM_TACH1:
// TODO
break;
}
} }
@ -482,12 +480,10 @@ void victor_9000_fdc_t::update_spindle_motor()
if (m_sel0) m_da0 = m_da; if (m_sel0) m_da0 = m_da;
m_floppy0->mon_w(m_mtr0); m_floppy0->mon_w(m_mtr0);
m_floppy0->set_rpm(300); // TODO m_floppy0->set_rpm(300); // TODO
t_tach0->adjust(attotime::never); // TODO
if (m_sel1) m_da1 = m_da; if (m_sel1) m_da1 = m_da;
m_floppy1->mon_w(m_mtr1); m_floppy1->mon_w(m_mtr1);
m_floppy1->set_rpm(300); // TODO m_floppy1->set_rpm(300); // TODO
t_tach1->adjust(attotime::never); // TODO
} }

View File

@ -97,13 +97,6 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const; virtual machine_config_constructor device_mconfig_additions() const;
private: private:
enum
{
TM_GEN,
TM_TACH0,
TM_TACH1
};
enum enum
{ {
LED_A = 0, LED_A = 0,
@ -167,9 +160,11 @@ private:
void ready0_cb(floppy_image_device *, int device); void ready0_cb(floppy_image_device *, int device);
int load0_cb(floppy_image_device *device); int load0_cb(floppy_image_device *device);
void unload0_cb(floppy_image_device *device); void unload0_cb(floppy_image_device *device);
void index0_cb(floppy_image_device *device, int state);
void ready1_cb(floppy_image_device *, int device); void ready1_cb(floppy_image_device *, int device);
int load1_cb(floppy_image_device *device); int load1_cb(floppy_image_device *device);
void unload1_cb(floppy_image_device *device); void unload1_cb(floppy_image_device *device);
void index1_cb(floppy_image_device *device, int state);
/* floppy state */ /* floppy state */
UINT8 m_da; UINT8 m_da;
@ -207,7 +202,7 @@ private:
attotime m_period; attotime m_period;
live_info cur_live, checkpoint_live; live_info cur_live, checkpoint_live;
emu_timer *t_gen, *t_tach0, *t_tach1; emu_timer *t_gen;
floppy_image_device* get_floppy(); floppy_image_device* get_floppy();
void live_start(); void live_start();