mirror of
https://github.com/holub/mame
synced 2025-05-22 05:38:52 +03:00
(MESS) victor9k: Floppy WIP. (nw)
This commit is contained in:
parent
841e3376cc
commit
eee1cbdc5e
@ -2,39 +2,39 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/victor9k_dsk.c
|
||||
formats/victor9k_dsk.c
|
||||
|
||||
Victor 9000 sector disk image format
|
||||
Victor 9000 sector disk image format
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
Sector format
|
||||
-------------
|
||||
Sector format
|
||||
-------------
|
||||
|
||||
Header sync
|
||||
Sector header (header ID, track ID, sector ID, and checksum)
|
||||
Gap 1
|
||||
Data Sync
|
||||
Data field (data sync, data ID, data bytes, and checksum)
|
||||
Gap 2
|
||||
Header sync
|
||||
Sector header (header ID, track ID, sector ID, and checksum)
|
||||
Gap 1
|
||||
Data Sync
|
||||
Data field (data sync, data ID, data bytes, and checksum)
|
||||
Gap 2
|
||||
|
||||
Track format
|
||||
------------
|
||||
Track format
|
||||
------------
|
||||
|
||||
ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL
|
||||
NUMBER TRACKS TRACKS PER TRACK PERIOD (MS)
|
||||
ZONE LOWER HEAD UPPER HEAD SECTORS ROTATIONAL RPM
|
||||
NUMBER TRACKS TRACKS PER TRACK PERIOD (MS)
|
||||
|
||||
0 0-3 unused 19 237.9
|
||||
1 4-15 0-7 18 224.5
|
||||
2 16-26 8-18 17 212.2
|
||||
3 27-37 19-29 16 199.9
|
||||
4 38-48 30-40 15 187.6
|
||||
5 49-59 41-51 14 175.3
|
||||
6 60-70 52-62 13 163.0
|
||||
7 71-79 63-74 12 149.6
|
||||
8 unused 75-79 11 144.0
|
||||
0 0-3 unused 19 237.9 252
|
||||
1 4-15 0-7 18 224.5 267
|
||||
2 16-26 8-18 17 212.2 283
|
||||
3 27-37 19-29 16 199.9 300
|
||||
4 38-48 30-40 15 187.6 320
|
||||
5 49-59 41-51 14 175.3 342
|
||||
6 60-70 52-62 13 163.0 368
|
||||
7 71-79 63-74 12 149.6 401
|
||||
8 unused 75-79 11 144.0 417
|
||||
|
||||
*/
|
||||
|
||||
@ -47,57 +47,95 @@ victor9k_format::victor9k_format()
|
||||
|
||||
const char *victor9k_format::name() const
|
||||
{
|
||||
return "victor9k";
|
||||
return "victor9k";
|
||||
}
|
||||
|
||||
const char *victor9k_format::description() const
|
||||
{
|
||||
return "Victor 9000 disk image";
|
||||
return "Victor 9000 disk image";
|
||||
}
|
||||
|
||||
const char *victor9k_format::extensions() const
|
||||
{
|
||||
return "img";
|
||||
return "img";
|
||||
}
|
||||
|
||||
int victor9k_format::identify(io_generic *io, UINT32 form_factor)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool victor9k_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool victor9k_format::supports_save() const
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
const victor9k_format::format victor9k_format::formats[] = {
|
||||
{ //
|
||||
floppy_image::FF_525, floppy_image::SSDD, 80, 1, 256
|
||||
},
|
||||
{ //
|
||||
floppy_image::FF_525, floppy_image::DSDD, 80, 2, 256
|
||||
},
|
||||
{}
|
||||
{ //
|
||||
floppy_image::FF_525, floppy_image::SSDD, 80, 1, 512
|
||||
},
|
||||
{ //
|
||||
floppy_image::FF_525, floppy_image::DSDD, 80, 2, 512
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
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>;
|
||||
|
@ -38,8 +38,8 @@ protected:
|
||||
static const format formats[];
|
||||
|
||||
static const UINT32 cell_size[];
|
||||
static const int sectors_per_track[];
|
||||
static const int speed_zone[];
|
||||
static const int sectors_per_track[2][80];
|
||||
static const int speed_zone[2][80];
|
||||
};
|
||||
|
||||
extern const floppy_format_type FLOPPY_VICTOR_9000_FORMAT;
|
||||
|
@ -509,6 +509,8 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state )
|
||||
|
||||
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_SYN_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir0_w))
|
||||
MCFG_VICTOR_9000_FDC_LBRDY_CB(INPUTLINE(I8088_TAG, INPUT_LINE_TEST))
|
||||
|
||||
// internal ram
|
||||
MCFG_RAM_ADD(RAM_TAG)
|
||||
|
@ -17,7 +17,6 @@
|
||||
- spindle speed
|
||||
- stepper
|
||||
- read PLL
|
||||
- TACH0/1
|
||||
- write logic
|
||||
|
||||
*/
|
||||
@ -109,6 +108,11 @@ void victor_9000_fdc_t::unload0_cb(floppy_image_device *device)
|
||||
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)
|
||||
{
|
||||
m_rdy1 = state;
|
||||
@ -132,8 +136,14 @@ void victor_9000_fdc_t::unload1_cb(floppy_image_device *device)
|
||||
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 )
|
||||
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
|
||||
|
||||
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()
|
||||
{
|
||||
// allocate timer
|
||||
t_gen = timer_alloc(TM_GEN);
|
||||
t_tach0 = timer_alloc(TM_TACH0);
|
||||
t_tach1 = timer_alloc(TM_TACH1);
|
||||
t_gen = timer_alloc(0);
|
||||
|
||||
// state saving
|
||||
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_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_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_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_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)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case TM_GEN:
|
||||
live_sync();
|
||||
live_run();
|
||||
|
||||
case TM_TACH0:
|
||||
// TODO
|
||||
break;
|
||||
|
||||
case TM_TACH1:
|
||||
// TODO
|
||||
break;
|
||||
}
|
||||
live_sync();
|
||||
live_run();
|
||||
}
|
||||
|
||||
|
||||
@ -482,12 +480,10 @@ void victor_9000_fdc_t::update_spindle_motor()
|
||||
if (m_sel0) m_da0 = m_da;
|
||||
m_floppy0->mon_w(m_mtr0);
|
||||
m_floppy0->set_rpm(300); // TODO
|
||||
t_tach0->adjust(attotime::never); // TODO
|
||||
|
||||
if (m_sel1) m_da1 = m_da;
|
||||
m_floppy1->mon_w(m_mtr1);
|
||||
m_floppy1->set_rpm(300); // TODO
|
||||
t_tach1->adjust(attotime::never); // TODO
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,13 +97,6 @@ protected:
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
TM_GEN,
|
||||
TM_TACH0,
|
||||
TM_TACH1
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
LED_A = 0,
|
||||
@ -167,9 +160,11 @@ private:
|
||||
void ready0_cb(floppy_image_device *, int device);
|
||||
int load0_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);
|
||||
int load1_cb(floppy_image_device *device);
|
||||
void unload1_cb(floppy_image_device *device);
|
||||
void index1_cb(floppy_image_device *device, int state);
|
||||
|
||||
/* floppy state */
|
||||
UINT8 m_da;
|
||||
@ -207,7 +202,7 @@ private:
|
||||
attotime m_period;
|
||||
|
||||
live_info cur_live, checkpoint_live;
|
||||
emu_timer *t_gen, *t_tach0, *t_tach1;
|
||||
emu_timer *t_gen;
|
||||
|
||||
floppy_image_device* get_floppy();
|
||||
void live_start();
|
||||
|
Loading…
Reference in New Issue
Block a user