trunk/src/emu/bus/ieee488/c2040fdc.c
| r31167 | r31168 | |
| 208 | 208 | get_next_edge(cur_live.tm); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | | void c2040_fdc_t::start_writing(attotime tm) |
| 211 | void c2040_fdc_t::start_writing(const attotime &tm) |
| 212 | 212 | { |
| 213 | 213 | cur_live.write_start_time = tm; |
| 214 | 214 | cur_live.write_position = 0; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | | void c2040_fdc_t::stop_writing(attotime tm) |
| 217 | void c2040_fdc_t::stop_writing(const attotime &tm) |
| 218 | 218 | { |
| 219 | 219 | commit(tm); |
| 220 | 220 | cur_live.write_start_time = attotime::never; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | | bool c2040_fdc_t::write_next_bit(bool bit, attotime limit) |
| 223 | bool c2040_fdc_t::write_next_bit(bool bit, const attotime &limit) |
| 224 | 224 | { |
| 225 | 225 | if(cur_live.write_start_time.is_never()) { |
| 226 | 226 | cur_live.write_start_time = cur_live.tm; |
| r31167 | r31168 | |
| 239 | 239 | return false; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | | void c2040_fdc_t::commit(attotime tm) |
| 242 | void c2040_fdc_t::commit(const attotime &tm) |
| 243 | 243 | { |
| 244 | 244 | if(cur_live.write_start_time.is_never() || tm == cur_live.write_start_time || !cur_live.write_position) |
| 245 | 245 | return; |
| r31167 | r31168 | |
| 305 | 305 | cur_live.error = 1; |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | | void c2040_fdc_t::live_run(attotime limit) |
| 308 | void c2040_fdc_t::live_run(const attotime &limit) |
| 309 | 309 | { |
| 310 | 310 | if(cur_live.state == IDLE || cur_live.next_state != -1) |
| 311 | 311 | return; |
| r31167 | r31168 | |
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | | void c2040_fdc_t::get_next_edge(attotime when) |
| 441 | void c2040_fdc_t::get_next_edge(const attotime &when) |
| 442 | 442 | { |
| 443 | 443 | floppy_image_device *floppy = get_floppy(); |
| 444 | 444 | |
| 445 | 445 | cur_live.edge = floppy ? floppy->get_next_transition(when) : attotime::never; |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | | int c2040_fdc_t::get_next_bit(attotime &tm, attotime limit) |
| 448 | int c2040_fdc_t::get_next_bit(attotime &tm, const attotime &limit) |
| 449 | 449 | { |
| 450 | 450 | attotime next = tm + m_period; |
| 451 | 451 | |
trunk/src/emu/machine/64h156.c
| r31167 | r31168 | |
| 166 | 166 | get_next_edge(cur_live.tm); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | | void c64h156_device::start_writing(attotime tm) |
| 169 | void c64h156_device::start_writing(const attotime &tm) |
| 170 | 170 | { |
| 171 | 171 | cur_live.write_start_time = tm; |
| 172 | 172 | cur_live.write_position = 0; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | | void c64h156_device::stop_writing(attotime tm) |
| 175 | void c64h156_device::stop_writing(const attotime &tm) |
| 176 | 176 | { |
| 177 | 177 | commit(tm); |
| 178 | 178 | cur_live.write_start_time = attotime::never; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | | bool c64h156_device::write_next_bit(bool bit, attotime limit) |
| 181 | bool c64h156_device::write_next_bit(bool bit, const attotime &limit) |
| 182 | 182 | { |
| 183 | 183 | if(cur_live.write_start_time.is_never()) { |
| 184 | 184 | cur_live.write_start_time = cur_live.tm; |
| r31167 | r31168 | |
| 197 | 197 | return false; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | | void c64h156_device::commit(attotime tm) |
| 200 | void c64h156_device::commit(const attotime &tm) |
| 201 | 201 | { |
| 202 | 202 | if(cur_live.write_start_time.is_never() || tm == cur_live.write_start_time || !cur_live.write_position) |
| 203 | 203 | return; |
| r31167 | r31168 | |
| 261 | 261 | cur_live.byte = 1; |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | | void c64h156_device::live_run(attotime limit) |
| 264 | void c64h156_device::live_run(const attotime &limit) |
| 265 | 265 | { |
| 266 | 266 | if(cur_live.state == IDLE || cur_live.next_state != -1) |
| 267 | 267 | return; |
| r31167 | r31168 | |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | | void c64h156_device::get_next_edge(attotime when) |
| 381 | void c64h156_device::get_next_edge(const attotime &when) |
| 382 | 382 | { |
| 383 | 383 | cur_live.edge = m_floppy->get_next_transition(when); |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | | int c64h156_device::get_next_bit(attotime &tm, attotime limit) |
| 386 | int c64h156_device::get_next_bit(attotime &tm, const attotime &limit) |
| 387 | 387 | { |
| 388 | 388 | attotime next = tm + m_period; |
| 389 | 389 | |
trunk/src/emu/machine/amigafdc.c
| r31167 | r31168 | |
| 172 | 172 | cur_live.next_state = -1; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | | void amiga_fdc::live_run(attotime limit) |
| 175 | void amiga_fdc::live_run(const attotime &limit) |
| 176 | 176 | { |
| 177 | 177 | amiga_state *state = machine().driver_data<amiga_state>(); |
| 178 | 178 | |
| r31167 | r31168 | |
| 507 | 507 | m_write_index(!state); |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | | void amiga_fdc::pll_t::set_clock(attotime period) |
| 510 | void amiga_fdc::pll_t::set_clock(const attotime &period) |
| 511 | 511 | { |
| 512 | 512 | for(int i=0; i<38; i++) |
| 513 | 513 | delays[i] = period*(i+1); |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | | void amiga_fdc::pll_t::reset(attotime when) |
| 516 | void amiga_fdc::pll_t::reset(const attotime &when) |
| 517 | 517 | { |
| 518 | 518 | counter = 0; |
| 519 | 519 | increment = 146; |
| r31167 | r31168 | |
| 527 | 527 | freq_sub = 0x00; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | | int amiga_fdc::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit) |
| 530 | int amiga_fdc::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 531 | 531 | { |
| 532 | 532 | attotime when = floppy ? floppy->get_next_transition(ctime) : attotime::never; |
| 533 | 533 | |
| r31167 | r31168 | |
| 601 | 601 | return bit; |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | | void amiga_fdc::pll_t::start_writing(attotime tm) |
| 604 | void amiga_fdc::pll_t::start_writing(const attotime & tm) |
| 605 | 605 | { |
| 606 | 606 | write_start_time = tm; |
| 607 | 607 | write_position = 0; |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | | void amiga_fdc::pll_t::stop_writing(floppy_image_device *floppy, attotime tm) |
| 610 | void amiga_fdc::pll_t::stop_writing(floppy_image_device *floppy, const attotime &tm) |
| 611 | 611 | { |
| 612 | 612 | commit(floppy, tm); |
| 613 | 613 | write_start_time = attotime::never; |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | | bool amiga_fdc::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit) |
| 616 | bool amiga_fdc::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 617 | 617 | { |
| 618 | 618 | if(write_start_time.is_never()) { |
| 619 | 619 | write_start_time = ctime; |
| r31167 | r31168 | |
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | |
| 647 | | void amiga_fdc::pll_t::commit(floppy_image_device *floppy, attotime tm) |
| 647 | void amiga_fdc::pll_t::commit(floppy_image_device *floppy, const attotime &tm) |
| 648 | 648 | { |
| 649 | 649 | if(write_start_time.is_never() || tm == write_start_time) |
| 650 | 650 | return; |
trunk/src/emu/machine/amigafdc.h
| r31167 | r31168 | |
| 66 | 66 | attotime write_buffer[32]; |
| 67 | 67 | int write_position; |
| 68 | 68 | |
| 69 | | void set_clock(attotime period); |
| 70 | | void reset(attotime when); |
| 71 | | int get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit); |
| 72 | | bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit); |
| 73 | | void start_writing(attotime tm); |
| 74 | | void commit(floppy_image_device *floppy, attotime tm); |
| 75 | | void stop_writing(floppy_image_device *floppy, attotime tm); |
| 69 | void set_clock(const attotime &period); |
| 70 | void reset(const attotime &when); |
| 71 | int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 72 | bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 73 | void start_writing(const attotime &tm); |
| 74 | void commit(floppy_image_device *floppy, const attotime &tm); |
| 75 | void stop_writing(floppy_image_device *floppy, const attotime &tm); |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | 78 | struct live_info { |
| r31167 | r31168 | |
| 111 | 111 | void live_delay(int state); |
| 112 | 112 | void live_sync(); |
| 113 | 113 | void live_abort(); |
| 114 | | void live_run(attotime limit = attotime::never); |
| 114 | void live_run(const attotime &limit = attotime::never); |
| 115 | 115 | }; |
| 116 | 116 | |
| 117 | 117 | extern const device_type AMIGA_FDC; |
trunk/src/emu/machine/fdc_pll.c
| r31167 | r31168 | |
| 11 | 11 | return buf; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | | void fdc_pll_t::set_clock(attotime _period) |
| 14 | void fdc_pll_t::set_clock(const attotime &_period) |
| 15 | 15 | { |
| 16 | 16 | period = _period; |
| 17 | 17 | period_adjust_base = period * 0.05; |
| r31167 | r31168 | |
| 19 | 19 | max_period = period * 1.25; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | | void fdc_pll_t::reset(attotime when) |
| 22 | void fdc_pll_t::reset(const attotime &when) |
| 23 | 23 | { |
| 24 | 24 | ctime = when; |
| 25 | 25 | phase_adjust = attotime::zero; |
| r31167 | r31168 | |
| 28 | 28 | write_start_time = attotime::never; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | | void fdc_pll_t::start_writing(attotime tm) |
| 31 | void fdc_pll_t::start_writing(const attotime &tm) |
| 32 | 32 | { |
| 33 | 33 | write_start_time = tm; |
| 34 | 34 | write_position = 0; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | | void fdc_pll_t::stop_writing(floppy_image_device *floppy, attotime tm) |
| 37 | void fdc_pll_t::stop_writing(floppy_image_device *floppy, const attotime &tm) |
| 38 | 38 | { |
| 39 | 39 | commit(floppy, tm); |
| 40 | 40 | write_start_time = attotime::never; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | | void fdc_pll_t::commit(floppy_image_device *floppy, attotime tm) |
| 43 | void fdc_pll_t::commit(floppy_image_device *floppy, const attotime &tm) |
| 44 | 44 | { |
| 45 | 45 | if(write_start_time.is_never() || tm == write_start_time) |
| 46 | 46 | return; |
| r31167 | r31168 | |
| 51 | 51 | write_position = 0; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | | int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit) |
| 54 | int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 55 | 55 | { |
| 56 | 56 | attotime edge = floppy ? floppy->get_next_transition(ctime) : attotime::never; |
| 57 | 57 | |
| r31167 | r31168 | |
| 112 | 112 | return 1; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | | bool fdc_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit) |
| 115 | bool fdc_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 116 | 116 | { |
| 117 | 117 | if(write_start_time.is_never()) { |
| 118 | 118 | write_start_time = ctime; |
trunk/src/emu/machine/wd_fdc.c
| r31167 | r31168 | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | | astring wd_fdc_t::tts(attotime t) |
| 191 | astring wd_fdc_t::tts(const attotime &t) |
| 192 | 192 | { |
| 193 | 193 | char buf[256]; |
| 194 | 194 | int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND; |
| r31167 | r31168 | |
| 1394 | 1394 | cur_live.next_state = -1; |
| 1395 | 1395 | } |
| 1396 | 1396 | |
| 1397 | | bool wd_fdc_t::read_one_bit(attotime limit) |
| 1397 | bool wd_fdc_t::read_one_bit(const attotime &limit) |
| 1398 | 1398 | { |
| 1399 | 1399 | int bit = pll_get_next_bit(cur_live.tm, floppy, limit); |
| 1400 | 1400 | if(bit < 0) |
| r31167 | r31168 | |
| 1412 | 1412 | return false; |
| 1413 | 1413 | } |
| 1414 | 1414 | |
| 1415 | | bool wd_fdc_t::write_one_bit(attotime limit) |
| 1415 | bool wd_fdc_t::write_one_bit(const attotime &limit) |
| 1416 | 1416 | { |
| 1417 | 1417 | bool bit = cur_live.shift_reg & 0x8000; |
| 1418 | 1418 | if(pll_write_next_bit(bit, cur_live.tm, floppy, limit)) |
| r31167 | r31168 | |
| 2092 | 2092 | clock_ratio = 1; |
| 2093 | 2093 | } |
| 2094 | 2094 | |
| 2095 | | void wd_fdc_analog_t::pll_reset(bool fm, attotime when) |
| 2095 | void wd_fdc_analog_t::pll_reset(bool fm, const attotime &when) |
| 2096 | 2096 | { |
| 2097 | 2097 | cur_pll.reset(when); |
| 2098 | 2098 | cur_pll.set_clock(clocks_to_attotime(fm ? 4 : 2)); |
| 2099 | 2099 | } |
| 2100 | 2100 | |
| 2101 | | void wd_fdc_analog_t::pll_start_writing(attotime tm) |
| 2101 | void wd_fdc_analog_t::pll_start_writing(const attotime &tm) |
| 2102 | 2102 | { |
| 2103 | 2103 | cur_pll.start_writing(tm); |
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | | void wd_fdc_analog_t::pll_commit(floppy_image_device *floppy, attotime tm) |
| 2106 | void wd_fdc_analog_t::pll_commit(floppy_image_device *floppy, const attotime &tm) |
| 2107 | 2107 | { |
| 2108 | 2108 | cur_pll.commit(floppy, tm); |
| 2109 | 2109 | } |
| 2110 | 2110 | |
| 2111 | | void wd_fdc_analog_t::pll_stop_writing(floppy_image_device *floppy, attotime tm) |
| 2111 | void wd_fdc_analog_t::pll_stop_writing(floppy_image_device *floppy, const attotime &tm) |
| 2112 | 2112 | { |
| 2113 | 2113 | cur_pll.stop_writing(floppy, tm); |
| 2114 | 2114 | } |
| r31167 | r31168 | |
| 2123 | 2123 | cur_pll = checkpoint_pll; |
| 2124 | 2124 | } |
| 2125 | 2125 | |
| 2126 | | int wd_fdc_analog_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit) |
| 2126 | int wd_fdc_analog_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 2127 | 2127 | { |
| 2128 | 2128 | return cur_pll.get_next_bit(tm, floppy, limit); |
| 2129 | 2129 | } |
| 2130 | 2130 | |
| 2131 | | bool wd_fdc_analog_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit) |
| 2131 | bool wd_fdc_analog_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 2132 | 2132 | { |
| 2133 | 2133 | return cur_pll.write_next_bit(bit, tm, floppy, limit); |
| 2134 | 2134 | } |
| r31167 | r31168 | |
| 2141 | 2141 | |
| 2142 | 2142 | const int wd_fdc_digital_t::wd_digital_step_times[4] = { 12000, 24000, 40000, 60000 }; |
| 2143 | 2143 | |
| 2144 | | void wd_fdc_digital_t::pll_reset(bool fm, attotime when) |
| 2144 | void wd_fdc_digital_t::pll_reset(bool fm, const attotime &when) |
| 2145 | 2145 | { |
| 2146 | 2146 | cur_pll.reset(when); |
| 2147 | 2147 | cur_pll.set_clock(clocks_to_attotime(fm ? 2 : 1)); // HACK |
| 2148 | 2148 | } |
| 2149 | 2149 | |
| 2150 | | void wd_fdc_digital_t::pll_start_writing(attotime tm) |
| 2150 | void wd_fdc_digital_t::pll_start_writing(const attotime &tm) |
| 2151 | 2151 | { |
| 2152 | 2152 | cur_pll.start_writing(tm); |
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | | void wd_fdc_digital_t::pll_commit(floppy_image_device *floppy, attotime tm) |
| 2155 | void wd_fdc_digital_t::pll_commit(floppy_image_device *floppy, const attotime &tm) |
| 2156 | 2156 | { |
| 2157 | 2157 | cur_pll.commit(floppy, tm); |
| 2158 | 2158 | } |
| 2159 | 2159 | |
| 2160 | | void wd_fdc_digital_t::pll_stop_writing(floppy_image_device *floppy, attotime tm) |
| 2160 | void wd_fdc_digital_t::pll_stop_writing(floppy_image_device *floppy, const attotime &tm) |
| 2161 | 2161 | { |
| 2162 | 2162 | cur_pll.stop_writing(floppy, tm); |
| 2163 | 2163 | } |
| 2164 | 2164 | |
| 2165 | | int wd_fdc_digital_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit) |
| 2165 | int wd_fdc_digital_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 2166 | 2166 | { |
| 2167 | 2167 | return cur_pll.get_next_bit(tm, floppy, limit); |
| 2168 | 2168 | } |
| 2169 | 2169 | |
| 2170 | | bool wd_fdc_digital_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit) |
| 2170 | bool wd_fdc_digital_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 2171 | 2171 | { |
| 2172 | 2172 | return cur_pll.write_next_bit(bit, tm, floppy, limit); |
| 2173 | 2173 | } |
| r31167 | r31168 | |
| 2182 | 2182 | cur_pll = checkpoint_pll; |
| 2183 | 2183 | } |
| 2184 | 2184 | |
| 2185 | | void wd_fdc_digital_t::digital_pll_t::set_clock(attotime period) |
| 2185 | void wd_fdc_digital_t::digital_pll_t::set_clock(const attotime &period) |
| 2186 | 2186 | { |
| 2187 | 2187 | for(int i=0; i<42; i++) |
| 2188 | 2188 | delays[i] = period*(i+1); |
| 2189 | 2189 | } |
| 2190 | 2190 | |
| 2191 | | void wd_fdc_digital_t::digital_pll_t::reset(attotime when) |
| 2191 | void wd_fdc_digital_t::digital_pll_t::reset(const attotime &when) |
| 2192 | 2192 | { |
| 2193 | 2193 | counter = 0; |
| 2194 | 2194 | increment = 128; |
| r31167 | r31168 | |
| 2204 | 2204 | write_start_time = attotime::never; |
| 2205 | 2205 | } |
| 2206 | 2206 | |
| 2207 | | int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit) |
| 2207 | int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 2208 | 2208 | { |
| 2209 | 2209 | attotime when = floppy ? floppy->get_next_transition(ctime) : attotime::never; |
| 2210 | 2210 | |
| r31167 | r31168 | |
| 2284 | 2284 | return bit; |
| 2285 | 2285 | } |
| 2286 | 2286 | |
| 2287 | | void wd_fdc_digital_t::digital_pll_t::start_writing(attotime tm) |
| 2287 | void wd_fdc_digital_t::digital_pll_t::start_writing(const attotime &tm) |
| 2288 | 2288 | { |
| 2289 | 2289 | write_start_time = tm; |
| 2290 | 2290 | write_position = 0; |
| 2291 | 2291 | } |
| 2292 | 2292 | |
| 2293 | | void wd_fdc_digital_t::digital_pll_t::stop_writing(floppy_image_device *floppy, attotime tm) |
| 2293 | void wd_fdc_digital_t::digital_pll_t::stop_writing(floppy_image_device *floppy, const attotime &tm) |
| 2294 | 2294 | { |
| 2295 | 2295 | commit(floppy, tm); |
| 2296 | 2296 | write_start_time = attotime::never; |
| 2297 | 2297 | } |
| 2298 | 2298 | |
| 2299 | | bool wd_fdc_digital_t::digital_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit) |
| 2299 | bool wd_fdc_digital_t::digital_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 2300 | 2300 | { |
| 2301 | 2301 | if(write_start_time.is_never()) { |
| 2302 | 2302 | write_start_time = ctime; |
| r31167 | r31168 | |
| 2326 | 2326 | return false; |
| 2327 | 2327 | } |
| 2328 | 2328 | |
| 2329 | | void wd_fdc_digital_t::digital_pll_t::commit(floppy_image_device *floppy, attotime tm) |
| 2329 | void wd_fdc_digital_t::digital_pll_t::commit(floppy_image_device *floppy, const attotime &tm) |
| 2330 | 2330 | { |
| 2331 | 2331 | if(write_start_time.is_never() || tm == write_start_time) |
| 2332 | 2332 | return; |
trunk/src/emu/machine/wd_fdc.h
| r31167 | r31168 | |
| 195 | 195 | virtual int calc_sector_size(UINT8 size, UINT8 command) const; |
| 196 | 196 | virtual int settle_time() const; |
| 197 | 197 | |
| 198 | | virtual void pll_reset(bool fm, attotime when) = 0; |
| 199 | | virtual void pll_start_writing(attotime tm) = 0; |
| 200 | | virtual void pll_commit(floppy_image_device *floppy, attotime tm) = 0; |
| 201 | | virtual void pll_stop_writing(floppy_image_device *floppy, attotime tm) = 0; |
| 202 | | virtual int pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit) = 0; |
| 203 | | virtual bool pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit) = 0; |
| 198 | virtual void pll_reset(bool fm, const attotime &when) = 0; |
| 199 | virtual void pll_start_writing(const attotime &tm) = 0; |
| 200 | virtual void pll_commit(floppy_image_device *floppy, const attotime &tm) = 0; |
| 201 | virtual void pll_stop_writing(floppy_image_device *floppy, const attotime &tm) = 0; |
| 202 | virtual int pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) = 0; |
| 203 | virtual bool pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) = 0; |
| 204 | 204 | virtual void pll_save_checkpoint() = 0; |
| 205 | 205 | virtual void pll_retrieve_checkpoint() = 0; |
| 206 | 206 | |
| r31167 | r31168 | |
| 370 | 370 | int format_last_byte_count; |
| 371 | 371 | astring format_description_string; |
| 372 | 372 | |
| 373 | | static astring tts(attotime t); |
| 373 | static astring tts(const attotime &t); |
| 374 | 374 | astring ttsn(); |
| 375 | 375 | |
| 376 | 376 | void delay_cycles(emu_timer *tm, int cycles); |
| r31167 | r31168 | |
| 419 | 419 | void live_delay(int state); |
| 420 | 420 | void live_sync(); |
| 421 | 421 | void live_run(attotime limit = attotime::never); |
| 422 | | bool read_one_bit(attotime limit); |
| 423 | | bool write_one_bit(attotime limit); |
| 422 | bool read_one_bit(const attotime &limit); |
| 423 | bool write_one_bit(const attotime &limit); |
| 424 | 424 | |
| 425 | 425 | void live_write_raw(UINT16 raw); |
| 426 | 426 | void live_write_mfm(UINT8 mfm); |
| r31167 | r31168 | |
| 435 | 435 | wd_fdc_analog_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); |
| 436 | 436 | |
| 437 | 437 | protected: |
| 438 | | virtual void pll_reset(bool fm, attotime when); |
| 439 | | virtual void pll_start_writing(attotime tm); |
| 440 | | virtual void pll_commit(floppy_image_device *floppy, attotime tm); |
| 441 | | virtual void pll_stop_writing(floppy_image_device *floppy, attotime tm); |
| 442 | | virtual int pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit); |
| 443 | | virtual bool pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit); |
| 438 | virtual void pll_reset(bool fm, const attotime &when); |
| 439 | virtual void pll_start_writing(const attotime &tm); |
| 440 | virtual void pll_commit(floppy_image_device *floppy, const attotime &tm); |
| 441 | virtual void pll_stop_writing(floppy_image_device *floppy, const attotime &tm); |
| 442 | virtual int pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 443 | virtual bool pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 444 | 444 | virtual void pll_save_checkpoint(); |
| 445 | 445 | virtual void pll_retrieve_checkpoint(); |
| 446 | 446 | |
| r31167 | r31168 | |
| 455 | 455 | protected: |
| 456 | 456 | static const int wd_digital_step_times[4]; |
| 457 | 457 | |
| 458 | | virtual void pll_reset(bool fm, attotime when); |
| 459 | | virtual void pll_start_writing(attotime tm); |
| 460 | | virtual void pll_commit(floppy_image_device *floppy, attotime tm); |
| 461 | | virtual void pll_stop_writing(floppy_image_device *floppy, attotime tm); |
| 462 | | virtual int pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit); |
| 463 | | virtual bool pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit); |
| 458 | virtual void pll_reset(bool fm, const attotime &when); |
| 459 | virtual void pll_start_writing(const attotime &tm); |
| 460 | virtual void pll_commit(floppy_image_device *floppy, const attotime &tm); |
| 461 | virtual void pll_stop_writing(floppy_image_device *floppy, const attotime &tm); |
| 462 | virtual int pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 463 | virtual bool pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 464 | 464 | virtual void pll_save_checkpoint(); |
| 465 | 465 | virtual void pll_retrieve_checkpoint(); |
| 466 | 466 | |
| r31167 | r31168 | |
| 480 | 480 | attotime write_buffer[32]; |
| 481 | 481 | int write_position; |
| 482 | 482 | |
| 483 | | void set_clock(attotime period); |
| 484 | | void reset(attotime when); |
| 485 | | int get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit); |
| 486 | | bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit); |
| 487 | | void start_writing(attotime tm); |
| 488 | | void commit(floppy_image_device *floppy, attotime tm); |
| 489 | | void stop_writing(floppy_image_device *floppy, attotime tm); |
| 483 | void set_clock(const attotime &period); |
| 484 | void reset(const attotime &when); |
| 485 | int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 486 | bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 487 | void start_writing(const attotime &tm); |
| 488 | void commit(floppy_image_device *floppy, const attotime &tm); |
| 489 | void stop_writing(floppy_image_device *floppy, const attotime &tm); |
| 490 | 490 | }; |
| 491 | 491 | |
| 492 | 492 | digital_pll_t cur_pll, checkpoint_pll; |