Previous 199869 Revisions Next

r31219 Monday 7th July, 2014 at 18:41:23 UTC by Mike Naberezny
(MESS) corvushd: Handle attempt to enter prep mode while in prep mode. (nw)
[src/emu/machine]corvushd.c corvushd.h

trunk/src/emu/machine/corvushd.c
r31218r31219
224224         //
225225         // Prep Commands
226226         //
227         case PREP_MODE_SELECT:              // Apparently I need to be able to do this while in Prep mode
227         case PREP_MODE_SELECT:             
228228         case PREP_RESET_DRIVE:
229229         case PREP_FORMAT_DRIVE:
230230         case PREP_FILL_DRIVE_OMNI:
r31218r31219
766766//
767767// Enter prep mode.  In prep mode, only prep mode commands may be executed.
768768//
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,
771771// and it is what actually implements prep mode commands.  This HLE ignores
772772// the prep block from the host. 
773773//
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//
774786// Pass:
775787//      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
777789//
778790// Returns:
779791//      Status of command
780792//
781793UINT8 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
782801   // check if drive is valid
783802   if (!corvus_hdc_file(drv)) {
784803      logerror("corvus_enter_prep_mode: Failure returned by corvus_hdc_file(%d)\n", drv);
r31218r31219
10601079      } else {    // In Prep mode
10611080         switch(m_buffer.command.code) {
10621081            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.
10631084               m_buffer.single_byte_response.status =
10641085                  corvus_enter_prep_mode(m_buffer.prep_mode_command.drive,
10651086                     m_buffer.prep_mode_command.prep_block);
trunk/src/emu/machine/corvushd.h
r31218r31219
407407      struct {
408408         UINT8   code;               // Command code
409409         UINT8   drive;              // Drive number (starts at 1)
410         UINT8    prep_block[512];    // Z80 machine code payload
410         UINT8    prep_block[512];    // Machine code payload
411411      } prep_mode_command;
412412      //
413413      // Read Firmware command (Prep Mode 0x32)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team