Previous 199869 Revisions Next

r33731 Sunday 7th December, 2014 at 11:00:32 UTC by Curt Coder
(MESS) victor9k: Floppy WIP. (nw)
[src/mess/machine]victor9k_fdc.c victor9k_fdc.h

trunk/src/mess/machine/victor9k_fdc.c
r242242r242243
2323   08      sync too long
2424   99      not a system disc
2525
26   11      Noise on sync
27   FF      No sync (bad or unformatted disk)
28
2629*/
2730
2831/*
r242242r242243
3235   - communication error with SCP after loading boot sector
3336      - bp ff1a8
3437      - patch ff1ab=c3
35   - data block checksum errors loading header track
36      - bp ff46a (ax = checksum read from disk, dx = calculated checksum)
37      - bit stream is offset by 1 bit at some point
38   - sync counter errors
39      - FF if sync byte counter loaded to 10
40      - 11 if sync byte counter loaded to 9
3841    - 8048 spindle speed control
39    - read PLL
4042    - write logic
4143
4244*/
r242242r242243
10641066   cur_live.wrsync = m_wrsync;
10651067   cur_live.erase = m_erase;
10661068
1069   pll_reset(cur_live.tm, attotime::from_nsec(2130));
10671070   checkpoint_live = cur_live;
1071   pll_save_checkpoint();
10681072
10691073   live_run();
10701074}
10711075
1076void victor_9000_fdc_t::pll_reset(const attotime &when, const attotime clock)
1077{
1078   cur_pll.reset(when);
1079   cur_pll.set_clock(clock);
1080}
1081
1082void victor_9000_fdc_t::pll_save_checkpoint()
1083{
1084   checkpoint_pll = cur_pll;
1085}
1086
1087void victor_9000_fdc_t::pll_retrieve_checkpoint()
1088{
1089   cur_pll = checkpoint_pll;
1090}
1091
10721092void victor_9000_fdc_t::checkpoint()
10731093{
1074   get_next_edge(machine().time());
10751094   checkpoint_live = cur_live;
1095   pll_save_checkpoint();
10761096}
10771097
10781098void victor_9000_fdc_t::rollback()
10791099{
10801100   cur_live = checkpoint_live;
1081   get_next_edge(cur_live.tm);
1101   pll_retrieve_checkpoint();
10821102}
10831103
10841104void victor_9000_fdc_t::start_writing(const attotime &tm)
r242242r242243
13151335   }
13161336}
13171337
1318void victor_9000_fdc_t::get_next_edge(const attotime &when)
1319{
1320   floppy_image_device *floppy = get_floppy();
1321
1322   cur_live.edge = floppy ? floppy->get_next_transition(when) : attotime::never;
1323}
1324
13251338int victor_9000_fdc_t::get_next_bit(attotime &tm, const attotime &limit)
13261339{
1327   attotime next = tm + m_period;
1328
1329   int bit = (cur_live.edge.is_never() || cur_live.edge >= next) ? 0 : 1;
1330
1331   if (bit) {
1332      get_next_edge(next);
1333   }
1334
1335   return bit;
1340   return cur_pll.get_next_bit(tm, get_floppy(), limit);
13361341}
trunk/src/mess/machine/victor9k_fdc.h
r242242r242243
1919#include "formats/victor9k_dsk.h"
2020#include "imagedev/floppy.h"
2121#include "machine/6522via.h"
22#include "machine/fdc_pll.h"
2223
2324
2425
r242242r242243
216217   attotime m_period;
217218
218219   live_info cur_live, checkpoint_live;
220   fdc_pll_t cur_pll, checkpoint_pll;
219221   emu_timer *t_gen, *t_tach0, *t_tach1;
220222
221223   floppy_image_device* get_floppy();
222224   void live_start();
225   void pll_reset(const attotime &when, const attotime clock);
226   void pll_save_checkpoint();
227   void pll_retrieve_checkpoint();
223228   void checkpoint();
224229   void rollback();
225230   bool write_next_bit(bool bit, const attotime &limit);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team