Previous 199869 Revisions Next

r26192 Saturday 16th November, 2013 at 09:19:06 UTC by Jürgen Buchmüller
Move setting the sector callback to alto2_cpu_device::interface_post_reset()
[/branches/alto2/src/emu/cpu/alto2]a2disk.c alto2.c alto2.h

branches/alto2/src/emu/cpu/alto2/a2disk.c
r26191r26192
6666#define   GET_KCOM_SENDADR(kcom)         A2_GET16(kcom,16,5,5)            //!< get send address flag from controller command (hardware command register)
6767#define   PUT_KCOM_SENDADR(kcom,val)      A2_PUT16(kcom,16,5,5,val)         //!< put send address flag into controller command (hardware command register)
6868
69/**
70 * @brief callback is called by the drive timer whenever a new sector starts
71 *
72 * @param unit the unit number
73 */
74static void disk_sector_start(void* cookie, int unit)
75{
76   alto2_cpu_device* cpu = reinterpret_cast<alto2_cpu_device *>(cookie);
77   cpu->next_sector(unit);
78}
79
8069/** @brief completion codes (only for documentation, since this is microcode defined) */
8170enum {
8271   STATUS_COMPLETION_GOOD,
r26191r26192
15191508   LOG((LOG_DISK,2,"   OK TO RUN -> %d\n", arg));
15201509   m_dsk.ok_to_run = arg;
15211510   m_dsk.ok_to_run_timer->reset();
1522
1523   for (int unit = 0; unit < diablo_hd_device::DIABLO_UNIT_MAX; unit++) {
1524      diablo_hd_device* dhd = m_drive[unit];
1525      dhd->set_sector_callback(this, &disk_sector_start);
1526   }
15271511}
15281512
15291513/**
branches/alto2/src/emu/cpu/alto2/alto2.c
r26191r26192
12451245   soft_reset();
12461246}
12471247
1248/**
1249 * @brief callback is called by the drive timer whenever a new sector starts
1250 *
1251 * @param unit the unit number
1252 */
1253static void disk_sector_start(void* cookie, int unit)
1254{
1255   alto2_cpu_device* cpu = reinterpret_cast<alto2_cpu_device *>(cookie);
1256   cpu->next_sector(unit);
1257}
1258
1259void alto2_cpu_device::interface_post_reset()
1260{
1261
1262   // set the disk unit sector callbacks
1263   for (int unit = 0; unit < diablo_hd_device::DIABLO_UNIT_MAX; unit++) {
1264      diablo_hd_device* dhd = m_drive[unit];
1265      dhd->set_sector_callback(this, &disk_sector_start);
1266   }
1267}
1268
12481269//-------------------------------------------------
12491270//  execute_set_input - act on a changed input/
12501271//  interrupt line
r26191r26192
30813102/** @brief software initiated reset (STARTF) */
30823103int alto2_cpu_device::soft_reset()
30833104{
3084   int task;
30853105
3086   for (task = 0; task < ALTO2_TASKS; task++) {
3106   for (int task = 0; task < ALTO2_TASKS; task++) {
30873107      // every task starts at mpc = task number, in either ROM0 or RAM0
30883108      m_task_mpc[task] = (m_ctl2k_u38[task] >> 4) ^ 017;
30893109      if (0 == (m_reset_mode & (1 << task)))
branches/alto2/src/emu/cpu/alto2/alto2.h
r26191r26192
232232   //! device-level override for reset
233233   virtual void device_reset();
234234
235   //! device-level override for post reset
236   void interface_post_reset();
237
235238   //! device_execute_interface overrides
236239   virtual UINT32 execute_min_cycles() const { return 1; }
237240   virtual UINT32 execute_max_cycles() const { return 1; }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team