Previous 199869 Revisions Next

r31168 Wednesday 2nd July, 2014 at 18:44:14 UTC by Oliver Stöneberg
first batch of passing attotime as const reference instead of copy - where possible (nw)
[src/emu/bus/ieee488]c2040fdc.c c2040fdc.h
[src/emu/imagedev]floppy.c floppy.h
[src/emu/machine]64h156.c 64h156.h amigafdc.c amigafdc.h fdc_pll.c fdc_pll.h wd_fdc.c wd_fdc.h wozfdc.c wozfdc.h

trunk/src/emu/imagedev/floppy.c
r31167r31168
557557   }
558558}
559559
560UINT32 floppy_image_device::find_position(attotime &base, attotime when)
560UINT32 floppy_image_device::find_position(attotime &base, const attotime &when)
561561{
562562   base = revolution_start_time;
563563   attotime delta = when - base;
r31167r31168
574574   return (delta*floppy_ratio_1 + attotime::from_nsec(500)).as_ticks(1000000000/1000);
575575}
576576
577attotime floppy_image_device::get_next_transition(attotime from_when)
577attotime floppy_image_device::get_next_transition(const attotime &from_when)
578578{
579579   if(!image || mon)
580580      return attotime::never;
r31167r31168
603603   return base + attotime::from_nsec((UINT64(next_position)*2000/floppy_ratio_1+1)/2);
604604}
605605
606void floppy_image_device::write_flux(attotime start, attotime end, int transition_count, const attotime *transitions)
606void floppy_image_device::write_flux(const attotime &start, const attotime &end, int transition_count, const attotime *transitions)
607607{
608608   if(!image || mon)
609609      return;
r31167r31168
762762   }
763763}
764764
765void floppy_image_device::set_write_splice(attotime when)
765void floppy_image_device::set_write_splice(const attotime &when)
766766{
767767   image_dirty = true;
768768   attotime base;
trunk/src/emu/imagedev/floppy.h
r31167r31168
112112
113113   void index_resync();
114114   attotime time_next_index();
115   attotime get_next_transition(attotime from_when);
116   void write_flux(attotime start, attotime end, int transition_count, const attotime *transitions);
117   void set_write_splice(attotime when);
115   attotime get_next_transition(const attotime &from_when);
116   void write_flux(const attotime &start, const attotime &end, int transition_count, const attotime *transitions);
117   void set_write_splice(const attotime &when);
118118   UINT32 get_form_factor() const;
119119   UINT32 get_variant() const;
120120
r31167r31168
175175   ready_cb cur_ready_cb;
176176   wpt_cb cur_wpt_cb;
177177
178   UINT32 find_position(attotime &base, attotime when);
178   UINT32 find_position(attotime &base, const attotime &when);
179179   int find_index(UINT32 position, const UINT32 *buf, int buf_size);
180180   void write_zone(UINT32 *buf, int &cells, int &index, UINT32 spos, UINT32 epos, UINT32 mg);
181181   void commit_image();
trunk/src/emu/bus/ieee488/c2040fdc.c
r31167r31168
208208   get_next_edge(cur_live.tm);
209209}
210210
211void c2040_fdc_t::start_writing(attotime tm)
211void c2040_fdc_t::start_writing(const attotime &tm)
212212{
213213   cur_live.write_start_time = tm;
214214   cur_live.write_position = 0;
215215}
216216
217void c2040_fdc_t::stop_writing(attotime tm)
217void c2040_fdc_t::stop_writing(const attotime &tm)
218218{
219219   commit(tm);
220220   cur_live.write_start_time = attotime::never;
221221}
222222
223bool c2040_fdc_t::write_next_bit(bool bit, attotime limit)
223bool c2040_fdc_t::write_next_bit(bool bit, const attotime &limit)
224224{
225225   if(cur_live.write_start_time.is_never()) {
226226      cur_live.write_start_time = cur_live.tm;
r31167r31168
239239   return false;
240240}
241241
242void c2040_fdc_t::commit(attotime tm)
242void c2040_fdc_t::commit(const attotime &tm)
243243{
244244   if(cur_live.write_start_time.is_never() || tm == cur_live.write_start_time || !cur_live.write_position)
245245      return;
r31167r31168
305305   cur_live.error = 1;
306306}
307307
308void c2040_fdc_t::live_run(attotime limit)
308void c2040_fdc_t::live_run(const attotime &limit)
309309{
310310   if(cur_live.state == IDLE || cur_live.next_state != -1)
311311      return;
r31167r31168
438438   }
439439}
440440
441void c2040_fdc_t::get_next_edge(attotime when)
441void c2040_fdc_t::get_next_edge(const attotime &when)
442442{
443443   floppy_image_device *floppy = get_floppy();
444444
445445   cur_live.edge = floppy ? floppy->get_next_transition(when) : attotime::never;
446446}
447447
448int c2040_fdc_t::get_next_bit(attotime &tm, attotime limit)
448int c2040_fdc_t::get_next_bit(attotime &tm, const attotime &limit)
449449{
450450   attotime next = tm + m_period;
451451
trunk/src/emu/bus/ieee488/c2040fdc.h
r31167r31168
149149   void live_start();
150150   void checkpoint();
151151   void rollback();
152   bool write_next_bit(bool bit, attotime limit);
153   void start_writing(attotime tm);
154   void commit(attotime tm);
155   void stop_writing(attotime tm);
152   bool write_next_bit(bool bit, const attotime &limit);
153   void start_writing(const attotime &tm);
154   void commit(const attotime &tm);
155   void stop_writing(const attotime &tm);
156156   void live_delay(int state);
157157   void live_sync();
158158   void live_abort();
159   void live_run(attotime limit = attotime::never);
160   void get_next_edge(attotime when);
161   int get_next_bit(attotime &tm, attotime limit);
159   void live_run(const attotime &limit = attotime::never);
160   void get_next_edge(const attotime &when);
161   int get_next_bit(attotime &tm, const attotime &limit);
162162};
163163
164164
trunk/src/emu/machine/64h156.c
r31167r31168
166166   get_next_edge(cur_live.tm);
167167}
168168
169void c64h156_device::start_writing(attotime tm)
169void c64h156_device::start_writing(const attotime &tm)
170170{
171171   cur_live.write_start_time = tm;
172172   cur_live.write_position = 0;
173173}
174174
175void c64h156_device::stop_writing(attotime tm)
175void c64h156_device::stop_writing(const attotime &tm)
176176{
177177   commit(tm);
178178   cur_live.write_start_time = attotime::never;
179179}
180180
181bool c64h156_device::write_next_bit(bool bit, attotime limit)
181bool c64h156_device::write_next_bit(bool bit, const attotime &limit)
182182{
183183   if(cur_live.write_start_time.is_never()) {
184184      cur_live.write_start_time = cur_live.tm;
r31167r31168
197197   return false;
198198}
199199
200void c64h156_device::commit(attotime tm)
200void c64h156_device::commit(const attotime &tm)
201201{
202202   if(cur_live.write_start_time.is_never() || tm == cur_live.write_start_time || !cur_live.write_position)
203203      return;
r31167r31168
261261   cur_live.byte = 1;
262262}
263263
264void c64h156_device::live_run(attotime limit)
264void c64h156_device::live_run(const attotime &limit)
265265{
266266   if(cur_live.state == IDLE || cur_live.next_state != -1)
267267      return;
r31167r31168
378378   }
379379}
380380
381void c64h156_device::get_next_edge(attotime when)
381void c64h156_device::get_next_edge(const attotime &when)
382382{
383383   cur_live.edge = m_floppy->get_next_transition(when);
384384}
385385
386int c64h156_device::get_next_bit(attotime &tm, attotime limit)
386int c64h156_device::get_next_bit(attotime &tm, const attotime &limit)
387387{
388388   attotime next = tm + m_period;
389389
trunk/src/emu/machine/64h156.h
r31167r31168
186186   void live_start();
187187   void checkpoint();
188188   void rollback();
189   bool write_next_bit(bool bit, attotime limit);
190   void start_writing(attotime tm);
191   void commit(attotime tm);
192   void stop_writing(attotime tm);
189   bool write_next_bit(bool bit, const attotime &limit);
190   void start_writing(const attotime &tm);
191   void commit(const attotime &tm);
192   void stop_writing(const attotime &tm);
193193   void live_delay(int state);
194194   void live_sync();
195195   void live_abort();
196   void live_run(attotime limit = attotime::never);
197   void get_next_edge(attotime when);
198   int get_next_bit(attotime &tm, attotime limit);
196   void live_run(const attotime &limit = attotime::never);
197   void get_next_edge(const attotime &when);
198   int get_next_bit(attotime &tm, const attotime &limit);
199199};
200200
201201
trunk/src/emu/machine/wozfdc.c
r31167r31168
336336      }
337337}
338338
339UINT64 wozfdc_device::time_to_cycles(attotime tm)
339UINT64 wozfdc_device::time_to_cycles(const attotime &tm)
340340{
341341   // Clock is falling edges of the ~2Mhz clock
342342   // The 1021800 must be the controlling 6502's speed
r31167r31168
365365   lss_predict();
366366}
367367
368void wozfdc_device::lss_delay(UINT64 cycles, attotime tm, UINT8 data_reg, UINT8 address, bool write_line_active)
368void wozfdc_device::lss_delay(UINT64 cycles, const attotime &tm, UINT8 data_reg, UINT8 address, bool write_line_active)
369369{
370370   if(data_reg & 0x80)
371371      address |= 0x02;
trunk/src/emu/machine/wozfdc.h
r31167r31168
7474
7575   void control(int offset);
7676   void phase(int ph, bool on);
77   UINT64 time_to_cycles(attotime tm);
77   UINT64 time_to_cycles(const attotime &tm);
7878   attotime cycles_to_time(UINT64 cycles);
7979   void a3_update_drive_sel();
8080
8181   void lss_start();
82   void lss_delay(UINT64 cycles, attotime tm, UINT8 data_reg, UINT8 address, bool write_line_active);
82   void lss_delay(UINT64 cycles, const attotime &tm, UINT8 data_reg, UINT8 address, bool write_line_active);
8383   void lss_delay(UINT64 cycles, UINT8 data_reg, UINT8 address, bool write_line_active);
8484   void lss_sync();
8585   void lss_predict(attotime limit = attotime::never);
trunk/src/emu/machine/amigafdc.c
r31167r31168
172172   cur_live.next_state = -1;
173173}
174174
175void amiga_fdc::live_run(attotime limit)
175void amiga_fdc::live_run(const attotime &limit)
176176{
177177   amiga_state *state = machine().driver_data<amiga_state>();
178178
r31167r31168
507507   m_write_index(!state);
508508}
509509
510void amiga_fdc::pll_t::set_clock(attotime period)
510void amiga_fdc::pll_t::set_clock(const attotime &period)
511511{
512512   for(int i=0; i<38; i++)
513513      delays[i] = period*(i+1);
514514}
515515
516void amiga_fdc::pll_t::reset(attotime when)
516void amiga_fdc::pll_t::reset(const attotime &when)
517517{
518518   counter = 0;
519519   increment = 146;
r31167r31168
527527   freq_sub  = 0x00;
528528}
529529
530int amiga_fdc::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
530int amiga_fdc::pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit)
531531{
532532   attotime when = floppy ? floppy->get_next_transition(ctime) : attotime::never;
533533
r31167r31168
601601   return bit;
602602}
603603
604void amiga_fdc::pll_t::start_writing(attotime tm)
604void amiga_fdc::pll_t::start_writing(const attotime & tm)
605605{
606606   write_start_time = tm;
607607   write_position = 0;
608608}
609609
610void amiga_fdc::pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
610void amiga_fdc::pll_t::stop_writing(floppy_image_device *floppy, const attotime &tm)
611611{
612612   commit(floppy, tm);
613613   write_start_time = attotime::never;
614614}
615615
616bool amiga_fdc::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
616bool amiga_fdc::pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
617617{
618618   if(write_start_time.is_never()) {
619619      write_start_time = ctime;
r31167r31168
644644}
645645
646646
647void amiga_fdc::pll_t::commit(floppy_image_device *floppy, attotime tm)
647void amiga_fdc::pll_t::commit(floppy_image_device *floppy, const attotime &tm)
648648{
649649   if(write_start_time.is_never() || tm == write_start_time)
650650      return;
trunk/src/emu/machine/amigafdc.h
r31167r31168
6666      attotime write_buffer[32];
6767      int write_position;
6868
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);
7676   };
7777
7878   struct live_info {
r31167r31168
111111   void live_delay(int state);
112112   void live_sync();
113113   void live_abort();
114   void live_run(attotime limit = attotime::never);
114   void live_run(const attotime &limit = attotime::never);
115115};
116116
117117extern const device_type AMIGA_FDC;
trunk/src/emu/machine/fdc_pll.c
r31167r31168
1111   return buf;
1212}
1313
14void fdc_pll_t::set_clock(attotime _period)
14void fdc_pll_t::set_clock(const attotime &_period)
1515{
1616   period = _period;
1717   period_adjust_base = period * 0.05;
r31167r31168
1919   max_period = period * 1.25;
2020}
2121
22void fdc_pll_t::reset(attotime when)
22void fdc_pll_t::reset(const attotime &when)
2323{
2424   ctime = when;
2525   phase_adjust = attotime::zero;
r31167r31168
2828   write_start_time = attotime::never;
2929}
3030
31void fdc_pll_t::start_writing(attotime tm)
31void fdc_pll_t::start_writing(const attotime &tm)
3232{
3333   write_start_time = tm;
3434   write_position = 0;
3535}
3636
37void fdc_pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
37void fdc_pll_t::stop_writing(floppy_image_device *floppy, const attotime &tm)
3838{
3939   commit(floppy, tm);
4040   write_start_time = attotime::never;
4141}
4242
43void fdc_pll_t::commit(floppy_image_device *floppy, attotime tm)
43void fdc_pll_t::commit(floppy_image_device *floppy, const attotime &tm)
4444{
4545   if(write_start_time.is_never() || tm == write_start_time)
4646      return;
r31167r31168
5151   write_position = 0;
5252}
5353
54int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
54int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit)
5555{
5656   attotime edge = floppy ? floppy->get_next_transition(ctime) : attotime::never;
5757
r31167r31168
112112   return 1;
113113}
114114
115bool fdc_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
115bool fdc_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
116116{
117117   if(write_start_time.is_never()) {
118118      write_start_time = ctime;
trunk/src/emu/machine/fdc_pll.h
r31167r31168
1717   int write_position;
1818   int freq_hist;
1919
20   void set_clock(attotime period);
21   void reset(attotime when);
22   int get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit);
23   bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit);
24   void start_writing(attotime tm);
25   void commit(floppy_image_device *floppy, attotime tm);
26   void stop_writing(floppy_image_device *floppy, attotime tm);
20   void set_clock(const attotime &period);
21   void reset(const attotime &when);
22   int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit);
23   bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit);
24   void start_writing(const attotime &tm);
25   void commit(floppy_image_device *floppy, const attotime &tm);
26   void stop_writing(floppy_image_device *floppy, const attotime &tm);
2727
2828   astring tts(attotime tm);
2929};
trunk/src/emu/machine/wd_fdc.c
r31167r31168
188188   }
189189}
190190
191astring wd_fdc_t::tts(attotime t)
191astring wd_fdc_t::tts(const attotime &t)
192192{
193193   char buf[256];
194194   int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
r31167r31168
13941394   cur_live.next_state = -1;
13951395}
13961396
1397bool wd_fdc_t::read_one_bit(attotime limit)
1397bool wd_fdc_t::read_one_bit(const attotime &limit)
13981398{
13991399   int bit = pll_get_next_bit(cur_live.tm, floppy, limit);
14001400   if(bit < 0)
r31167r31168
14121412   return false;
14131413}
14141414
1415bool wd_fdc_t::write_one_bit(attotime limit)
1415bool wd_fdc_t::write_one_bit(const attotime &limit)
14161416{
14171417   bool bit = cur_live.shift_reg & 0x8000;
14181418   if(pll_write_next_bit(bit, cur_live.tm, floppy, limit))
r31167r31168
20922092   clock_ratio = 1;
20932093}
20942094
2095void wd_fdc_analog_t::pll_reset(bool fm, attotime when)
2095void wd_fdc_analog_t::pll_reset(bool fm, const attotime &when)
20962096{
20972097   cur_pll.reset(when);
20982098   cur_pll.set_clock(clocks_to_attotime(fm ? 4 : 2));
20992099}
21002100
2101void wd_fdc_analog_t::pll_start_writing(attotime tm)
2101void wd_fdc_analog_t::pll_start_writing(const attotime &tm)
21022102{
21032103   cur_pll.start_writing(tm);
21042104}
21052105
2106void wd_fdc_analog_t::pll_commit(floppy_image_device *floppy, attotime tm)
2106void wd_fdc_analog_t::pll_commit(floppy_image_device *floppy, const attotime &tm)
21072107{
21082108   cur_pll.commit(floppy, tm);
21092109}
21102110
2111void wd_fdc_analog_t::pll_stop_writing(floppy_image_device *floppy, attotime tm)
2111void wd_fdc_analog_t::pll_stop_writing(floppy_image_device *floppy, const attotime &tm)
21122112{
21132113   cur_pll.stop_writing(floppy, tm);
21142114}
r31167r31168
21232123   cur_pll = checkpoint_pll;
21242124}
21252125
2126int wd_fdc_analog_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
2126int wd_fdc_analog_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit)
21272127{
21282128   return cur_pll.get_next_bit(tm, floppy, limit);
21292129}
21302130
2131bool wd_fdc_analog_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
2131bool wd_fdc_analog_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
21322132{
21332133   return cur_pll.write_next_bit(bit, tm, floppy, limit);
21342134}
r31167r31168
21412141
21422142const int wd_fdc_digital_t::wd_digital_step_times[4] = { 12000, 24000, 40000, 60000 };
21432143
2144void wd_fdc_digital_t::pll_reset(bool fm, attotime when)
2144void wd_fdc_digital_t::pll_reset(bool fm, const attotime &when)
21452145{
21462146   cur_pll.reset(when);
21472147   cur_pll.set_clock(clocks_to_attotime(fm ? 2 : 1)); // HACK
21482148}
21492149
2150void wd_fdc_digital_t::pll_start_writing(attotime tm)
2150void wd_fdc_digital_t::pll_start_writing(const attotime &tm)
21512151{
21522152   cur_pll.start_writing(tm);
21532153}
21542154
2155void wd_fdc_digital_t::pll_commit(floppy_image_device *floppy, attotime tm)
2155void wd_fdc_digital_t::pll_commit(floppy_image_device *floppy, const attotime &tm)
21562156{
21572157   cur_pll.commit(floppy, tm);
21582158}
21592159
2160void wd_fdc_digital_t::pll_stop_writing(floppy_image_device *floppy, attotime tm)
2160void wd_fdc_digital_t::pll_stop_writing(floppy_image_device *floppy, const attotime &tm)
21612161{
21622162   cur_pll.stop_writing(floppy, tm);
21632163}
21642164
2165int wd_fdc_digital_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
2165int wd_fdc_digital_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit)
21662166{
21672167   return cur_pll.get_next_bit(tm, floppy, limit);
21682168}
21692169
2170bool wd_fdc_digital_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
2170bool wd_fdc_digital_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
21712171{
21722172   return cur_pll.write_next_bit(bit, tm, floppy, limit);
21732173}
r31167r31168
21822182   cur_pll = checkpoint_pll;
21832183}
21842184
2185void wd_fdc_digital_t::digital_pll_t::set_clock(attotime period)
2185void wd_fdc_digital_t::digital_pll_t::set_clock(const attotime &period)
21862186{
21872187   for(int i=0; i<42; i++)
21882188      delays[i] = period*(i+1);
21892189}
21902190
2191void wd_fdc_digital_t::digital_pll_t::reset(attotime when)
2191void wd_fdc_digital_t::digital_pll_t::reset(const attotime &when)
21922192{
21932193   counter = 0;
21942194   increment = 128;
r31167r31168
22042204   write_start_time = attotime::never;
22052205}
22062206
2207int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit)
2207int wd_fdc_digital_t::digital_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit)
22082208{
22092209   attotime when = floppy ? floppy->get_next_transition(ctime) : attotime::never;
22102210
r31167r31168
22842284   return bit;
22852285}
22862286
2287void wd_fdc_digital_t::digital_pll_t::start_writing(attotime tm)
2287void wd_fdc_digital_t::digital_pll_t::start_writing(const attotime &tm)
22882288{
22892289   write_start_time = tm;
22902290   write_position = 0;
22912291}
22922292
2293void wd_fdc_digital_t::digital_pll_t::stop_writing(floppy_image_device *floppy, attotime tm)
2293void wd_fdc_digital_t::digital_pll_t::stop_writing(floppy_image_device *floppy, const attotime &tm)
22942294{
22952295   commit(floppy, tm);
22962296   write_start_time = attotime::never;
22972297}
22982298
2299bool wd_fdc_digital_t::digital_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit)
2299bool wd_fdc_digital_t::digital_pll_t::write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit)
23002300{
23012301   if(write_start_time.is_never()) {
23022302      write_start_time = ctime;
r31167r31168
23262326   return false;
23272327}
23282328
2329void wd_fdc_digital_t::digital_pll_t::commit(floppy_image_device *floppy, attotime tm)
2329void wd_fdc_digital_t::digital_pll_t::commit(floppy_image_device *floppy, const attotime &tm)
23302330{
23312331   if(write_start_time.is_never() || tm == write_start_time)
23322332      return;
trunk/src/emu/machine/wd_fdc.h
r31167r31168
195195   virtual int calc_sector_size(UINT8 size, UINT8 command) const;
196196   virtual int settle_time() const;
197197
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;
204204   virtual void pll_save_checkpoint() = 0;
205205   virtual void pll_retrieve_checkpoint() = 0;
206206
r31167r31168
370370   int format_last_byte_count;
371371   astring format_description_string;
372372
373   static astring tts(attotime t);
373   static astring tts(const attotime &t);
374374   astring ttsn();
375375
376376   void delay_cycles(emu_timer *tm, int cycles);
r31167r31168
419419   void live_delay(int state);
420420   void live_sync();
421421   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);
424424
425425   void live_write_raw(UINT16 raw);
426426   void live_write_mfm(UINT8 mfm);
r31167r31168
435435   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);
436436
437437protected:
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);
444444   virtual void pll_save_checkpoint();
445445   virtual void pll_retrieve_checkpoint();
446446
r31167r31168
455455protected:
456456   static const int wd_digital_step_times[4];
457457
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);
464464   virtual void pll_save_checkpoint();
465465   virtual void pll_retrieve_checkpoint();
466466
r31167r31168
480480      attotime write_buffer[32];
481481      int write_position;
482482
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);
490490   };
491491
492492   digital_pll_t cur_pll, checkpoint_pll;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team