Cleanup. (nw)

This commit is contained in:
Curt Coder 2015-04-11 20:56:40 +03:00
parent 1f63dae132
commit 7d7f5ca352
6 changed files with 15 additions and 18 deletions

View File

@ -28,6 +28,12 @@
#define LOG 0
#define GCR_DECODE(_e, _i) \
((BIT(_e, 6) << 7) | (BIT(_i, 7) << 6) | (_e & 0x33) | (BIT(_e, 2) << 3) | (_i & 0x04))
#define GCR_ENCODE(_e, _i) \
((_e & 0xc0) << 2 | (_i & 0x80) | (_e & 0x3c) << 1 | (_i & 0x04) | (_e & 0x03))
//**************************************************************************
@ -349,11 +355,7 @@ void c2040_fdc_t::live_run(const attotime &limit)
if (!ready) {
// load write shift register
// E7 E6 I7 E5 E4 E3 E2 I2 E1 E0
UINT8 e = cur_live.e;
offs_t i = cur_live.i;
cur_live.shift_reg_write = BIT(e,7)<<9 | BIT(e,6)<<8 | BIT(i,7)<<7 | BIT(e,5)<<6 | BIT(e,4)<<5 | BIT(e,3)<<4 | BIT(e,2)<<3 | BIT(i,2)<<2 | (e & 0x03);
cur_live.shift_reg_write = GCR_ENCODE(cur_live.e, cur_live.i);
if (LOG) logerror("%s load write shift register %03x\n",cur_live.tm.as_string(),cur_live.shift_reg_write);
} else if (BIT(cell_counter, 1) && !BIT(cur_live.cell_counter, 1)) {
@ -433,7 +435,7 @@ READ8_MEMBER( c2040_fdc_t::read )
UINT8 e = checkpoint_live.e;
offs_t i = checkpoint_live.i;
UINT8 data = (BIT(e, 6) << 7) | (BIT(i, 7) << 6) | (e & 0x33) | (BIT(e, 2) << 3) | (i & 0x04);
UINT8 data = GCR_DECODE(e, i);
if (LOG) logerror("%s %s VIA reads data %02x (%03x)\n", machine().time().as_string(), machine().describe_context(), data, checkpoint_live.shift_reg);

View File

@ -550,7 +550,6 @@ static MACHINE_CONFIG_FRAGMENT( c8050 )
MCFG_MOS6530n_OUT_PB1_CB(DEVWRITELINE(FDC_TAG, c8050_fdc_t, ds0_w))
MCFG_MOS6530n_OUT_PB2_CB(DEVWRITELINE(FDC_TAG, c8050_fdc_t, ds1_w))
MCFG_MOS6530n_IN_PB3_CB(DEVREADLINE(FDC_TAG, c8050_fdc_t, wps_r))
MCFG_MOS6530n_IN_PB6_CB(VCC) // SINGLE SIDED
MCFG_DEVICE_ADD(FDC_TAG, C8050_FDC, XTAL_12MHz/2)
MCFG_C8050_SYNC_CALLBACK(DEVWRITELINE(M6522_TAG, via6522_device, write_pb7))

View File

@ -230,8 +230,6 @@ void c8050_fdc_t::live_start()
cur_live.shift_reg = 0;
cur_live.shift_reg_write = 0;
cur_live.cycle_counter = 0;
cur_live.cell_counter = 0;
cur_live.bit_counter = 0;
cur_live.ds = m_ds;
cur_live.drv_sel = m_drv_sel;
@ -395,12 +393,12 @@ void c8050_fdc_t::live_run(const attotime &limit)
// GCR decoder
if (cur_live.rw_sel) {
cur_live.i = cur_live.shift_reg;
cur_live.i = (cur_live.rw_sel << 10) | cur_live.shift_reg;
} else {
cur_live.i = ((cur_live.pi & 0xf0) << 1) | (cur_live.mode_sel << 4) | (cur_live.pi & 0x0f);
cur_live.i = (cur_live.rw_sel << 10) | ((cur_live.pi & 0xf0) << 1) | (cur_live.mode_sel << 4) | (cur_live.pi & 0x0f);
}
cur_live.e = m_gcr_rom->base()[cur_live.rw_sel << 10 | cur_live.i];
cur_live.e = m_gcr_rom->base()[cur_live.i];
if (LOG) logerror("%s cyl %u bit %u sync %u bc %u sr %03x i %03x e %02x\n",cur_live.tm.as_string(),get_floppy()->get_cyl(),bit,sync,cur_live.bit_counter,cur_live.shift_reg,cur_live.i,cur_live.e);

View File

@ -110,8 +110,6 @@ protected:
attotime edge;
UINT16 shift_reg;
int cycle_counter;
int cell_counter;
int bit_counter;
UINT8 e;
offs_t i;

View File

@ -367,7 +367,7 @@ READ8_MEMBER( mos6530_t::pb_data_r )
UINT8 data = (out & ddr_out) | (in & ddr_in);
if (LOG) logerror("%s %s MOS6530 '%s' Port B Data In %02x\n", machine().time().as_string(), machine().describe_context(), tag(), data);
logerror("PB data read %02x\n",data);
return data;
}

View File

@ -1245,12 +1245,12 @@ void victor_9000_fdc_t::live_run(const attotime &limit)
// GCR decoder
if (cur_live.drw) {
cur_live.i = cur_live.shift_reg;
cur_live.i = cur_live.drw << 10 | cur_live.shift_reg;
} else {
cur_live.i = 0x200 | ((cur_live.wd & 0xf0) << 1) | cur_live.wrsync << 4 | (cur_live.wd & 0x0f);
cur_live.i = cur_live.drw << 10 | 0x200 | ((cur_live.wd & 0xf0) << 1) | cur_live.wrsync << 4 | (cur_live.wd & 0x0f);
}
cur_live.e = m_gcr_rom->base()[cur_live.drw << 10 | cur_live.i];
cur_live.e = m_gcr_rom->base()[cur_live.i];
attotime next = cur_live.tm + m_period;
if (LOG) logerror("%s:%s cyl %u bit %u sync %u bc %u sr %03x sbc %u sBC %u syn %u i %03x e %02x\n",cur_live.tm.as_string(),next.as_string(),get_floppy()->get_cyl(),bit,sync,cur_live.bit_counter,cur_live.shift_reg,cur_live.sync_bit_counter,cur_live.sync_byte_counter,syn,cur_live.i,cur_live.e);