OSDN Git Service

[BUILD][MZ2800] Fix FTBFS.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 30 Sep 2018 04:53:20 +0000 (13:53 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 30 Sep 2018 04:53:20 +0000 (13:53 +0900)
[BUILD][VM][SCSI_HDD] Fix FTBFS around SASI_HDD.

source/build-cmake/mz2800/CMakeLists.txt
source/src/vm/mz2800/CMakeLists.txt
source/src/vm/scsi_hdd.cpp
source/src/vm/scsi_hdd.h

index ea336c3..716f924 100644 (file)
@@ -20,7 +20,9 @@ set(WITH_MOUSE ON)
 
 set(VMFILES
                   mz1p17.cpp
-                  
+                  scsi_dev.cpp
+                  scsi_hdd.cpp
+                  scsi_host.cpp
                   event.cpp
                   io.cpp
 )
index e9d0197..b022258 100644 (file)
@@ -11,6 +11,7 @@ set(BASIC_VM_FILES
           memory.cpp
           mouse.cpp
           reset.cpp
+          sasi.cpp
           serial.cpp
           sysport.cpp
           printer.cpp
index ccfa061..a683fbd 100644 (file)
@@ -182,7 +182,7 @@ void SCSI_HDD::decl_state()
        enter_decl_state(STATE_VERSION);
 
        for(int i = 0; i < 8; i++) {
-               DECL_STATE_ENTRY_STRING_MEMBER(&(image_path[i][0]), MAX_PATH, i);
+               DECL_STATE_ENTRY_STRING_MEMBER(&(image_path[i][0]), _MAX_PATH, i);
        }
        DECL_STATE_ENTRY_1D_ARRAY(sector_size, sizeof(sector_size) / sizeof(int));  
        leave_decl_state();
@@ -236,3 +236,47 @@ bool SCSI_HDD::load_state(FILEIO* state_fio)
        return true;
 }
 
+int SASI_HDD::get_command_length(int value)
+{
+       return SCSI_HDD::get_command_length(value);
+}
+
+void SASI_HDD::start_command()
+{
+       switch(command[0]) {
+       case SCSI_CMD_REQ_SENSE:
+               #ifdef _SCSI_DEBUG_LOG
+                       this->out_debug_log(_T("[SASI_HDD:ID=%d] Command: Request Sense\n"), scsi_id);
+               #endif
+               // start position
+               position = (command[1] & 0x1f) * 0x10000 + command[2] * 0x100 + command[3];
+               position *= physical_block_size();
+               // transfer length
+               remain = 4;
+               // create sense data table
+               buffer->clear();
+               buffer->write(get_sense_code());
+               buffer->write(((max_logical_block_addr() >> 16) & 0x1f) | (get_logical_unit_number() << 5));
+               buffer->write(((max_logical_block_addr() >>  8) & 0xff));
+               buffer->write(((max_logical_block_addr() >>  0) & 0xff));
+               // change to data in phase
+               set_dat(buffer->read());
+               set_phase_delay(SCSI_PHASE_DATA_IN, 10.0);
+               set_sense_code(SCSI_SENSE_NOSENSE);
+               return;
+               
+       case 0xc2:
+               #ifdef _SCSI_DEBUG_LOG
+                       this->out_debug_log(_T("[SASI_HDD:ID=%d] Command: SASI Command 0xC2\n"), scsi_id);
+               #endif
+               // transfer length
+               remain = 10; // DTC\8cn (\83g\83\89\83\93\83W\83X\83^\8bZ\8fpSPECIAL No.27, P.88)
+               // clear data buffer
+               buffer->clear();
+               // change to data in phase
+               set_phase_delay(SCSI_PHASE_DATA_OUT, 1.0);
+               return;
+       }
+       // start standard command
+       SCSI_HDD::start_command();
+}
index bd57929..6a46095 100644 (file)
@@ -23,7 +23,7 @@ private:
 //protected:
 //     csp_state_utils *state_entry;
 
-       _TCHAR image_path[8][MAX_PATH];
+       _TCHAR image_path[8][_MAX_PATH];
        int sector_size[8];
        
 public: