branches/alto2/src/emu/cpu/alto2/a2disk.c
| r26191 | r26192 | |
| 66 | 66 | #define GET_KCOM_SENDADR(kcom) A2_GET16(kcom,16,5,5) //!< get send address flag from controller command (hardware command register) |
| 67 | 67 | #define PUT_KCOM_SENDADR(kcom,val) A2_PUT16(kcom,16,5,5,val) //!< put send address flag into controller command (hardware command register) |
| 68 | 68 | |
| 69 | | /** |
| 70 | | * @brief callback is called by the drive timer whenever a new sector starts |
| 71 | | * |
| 72 | | * @param unit the unit number |
| 73 | | */ |
| 74 | | static 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 | | |
| 80 | 69 | /** @brief completion codes (only for documentation, since this is microcode defined) */ |
| 81 | 70 | enum { |
| 82 | 71 | STATUS_COMPLETION_GOOD, |
| r26191 | r26192 | |
| 1519 | 1508 | LOG((LOG_DISK,2," OK TO RUN -> %d\n", arg)); |
| 1520 | 1509 | m_dsk.ok_to_run = arg; |
| 1521 | 1510 | 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 | | } |
| 1527 | 1511 | } |
| 1528 | 1512 | |
| 1529 | 1513 | /** |
branches/alto2/src/emu/cpu/alto2/alto2.c
| r26191 | r26192 | |
| 1245 | 1245 | soft_reset(); |
| 1246 | 1246 | } |
| 1247 | 1247 | |
| 1248 | /** |
| 1249 | * @brief callback is called by the drive timer whenever a new sector starts |
| 1250 | * |
| 1251 | * @param unit the unit number |
| 1252 | */ |
| 1253 | static 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 | |
| 1259 | void 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 | |
| 1248 | 1269 | //------------------------------------------------- |
| 1249 | 1270 | // execute_set_input - act on a changed input/ |
| 1250 | 1271 | // interrupt line |
| r26191 | r26192 | |
| 3081 | 3102 | /** @brief software initiated reset (STARTF) */ |
| 3082 | 3103 | int alto2_cpu_device::soft_reset() |
| 3083 | 3104 | { |
| 3084 | | int task; |
| 3085 | 3105 | |
| 3086 | | for (task = 0; task < ALTO2_TASKS; task++) { |
| 3106 | for (int task = 0; task < ALTO2_TASKS; task++) { |
| 3087 | 3107 | // every task starts at mpc = task number, in either ROM0 or RAM0 |
| 3088 | 3108 | m_task_mpc[task] = (m_ctl2k_u38[task] >> 4) ^ 017; |
| 3089 | 3109 | if (0 == (m_reset_mode & (1 << task))) |