trunk/src/emu/machine/corvushd.c
| r31218 | r31219 | |
| 224 | 224 | // |
| 225 | 225 | // Prep Commands |
| 226 | 226 | // |
| 227 | | case PREP_MODE_SELECT: // Apparently I need to be able to do this while in Prep mode |
| 227 | case PREP_MODE_SELECT: |
| 228 | 228 | case PREP_RESET_DRIVE: |
| 229 | 229 | case PREP_FORMAT_DRIVE: |
| 230 | 230 | case PREP_FILL_DRIVE_OMNI: |
| r31218 | r31219 | |
| 766 | 766 | // |
| 767 | 767 | // Enter prep mode. In prep mode, only prep mode commands may be executed. |
| 768 | 768 | // |
| 769 | | // The "prep block" is 512 bytes of Z80 machine code that the host sends to |
| 770 | | // the controller. The controller will jump to this code after receiving it, |
| 769 | // A "prep block" is 512 bytes of machine code that the host sends to the |
| 770 | // controller. The controller will jump to this code after receiving it, |
| 771 | 771 | // and it is what actually implements prep mode commands. This HLE ignores |
| 772 | 772 | // the prep block from the host. |
| 773 | 773 | // |
| 774 | // On the Rev B/H drives (which we emulate), a prep block is Z80 machine |
| 775 | // code and only one prep block can be sent. Sending the "put drive into |
| 776 | // prep mode" command (0x11) when already in prep mode is an error. The |
| 777 | // prep block sent by the Corvus program DIAG.COM on the SSE SoftBox |
| 778 | // distribution disk returns error 0x8f (unrecognized command) for this case. |
| 779 | // |
| 780 | // On the OmniDrive and Bank, a prep block is 6801 machine code. These |
| 781 | // controllers allow multiple prep blocks to be sent. The first time the |
| 782 | // "put drive into prep mode" command is sent puts the drive into prep mode. |
| 783 | // The command can then be sent again up to 3 times with more prep blocks. |
| 784 | // (Mass Storage GTI, pages 50-51) |
| 785 | // |
| 774 | 786 | // Pass: |
| 775 | 787 | // drv: Corvus drive id (1..15) to be prepped |
| 776 | | // prep_block: 512 bytes of Z80 machine code, contents ignored |
| 788 | // prep_block: 512 bytes of machine code, contents ignored |
| 777 | 789 | // |
| 778 | 790 | // Returns: |
| 779 | 791 | // Status of command |
| 780 | 792 | // |
| 781 | 793 | UINT8 corvus_hdc_t::corvus_enter_prep_mode(UINT8 drv, UINT8 *prep_block) { |
| 794 | // on rev b/h drives, sending the "put drive into prep mode" |
| 795 | // command when already in prep mode is an error. |
| 796 | if (m_prep_mode) { |
| 797 | logerror("corvus_enter_prep_mode: Attempt to enter prep mode while in prep mode\n"); |
| 798 | return STAT_FATAL_ERR | STAT_ILL_CMD_OP_CODE; |
| 799 | } |
| 800 | |
| 782 | 801 | // check if drive is valid |
| 783 | 802 | if (!corvus_hdc_file(drv)) { |
| 784 | 803 | logerror("corvus_enter_prep_mode: Failure returned by corvus_hdc_file(%d)\n", drv); |
| r31218 | r31219 | |
| 1060 | 1079 | } else { // In Prep mode |
| 1061 | 1080 | switch(m_buffer.command.code) { |
| 1062 | 1081 | case PREP_MODE_SELECT: |
| 1082 | // when already in prep mode, some drives allow this command to |
| 1083 | // be sent again. see corvus_enter_prep_mode() for details. |
| 1063 | 1084 | m_buffer.single_byte_response.status = |
| 1064 | 1085 | corvus_enter_prep_mode(m_buffer.prep_mode_command.drive, |
| 1065 | 1086 | m_buffer.prep_mode_command.prep_block); |