Subversion Repositories pentevo

Rev

Rev 796 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. #pragma once
  2.  
  3. struct TUpd765
  4. {
  5.     static constexpr u8 MSR_RQM = 0b10000000;
  6.     static constexpr u8 MSR_DIO = 0b01000000;
  7.     static constexpr u8 MSR_EXM = 0b00100000;
  8.     static constexpr u8 MSR_CB = 0b00010000;
  9.  
  10.     static constexpr u8 ST0_IC_MASK = 0b11000000;
  11.     static constexpr u8 ST0_NT = 0b00000000;
  12.     static constexpr u8 ST0_AT1 = 0b01000000;
  13.     static constexpr u8 ST0_IC = 0b10000000;
  14.     static constexpr u8 ST0_AT2 = 0b11000000;
  15.     static constexpr u8 ST0_SE = 0b00100000;
  16.     static constexpr u8 ST0_EC = 0b00010000;
  17.     static constexpr u8 ST0_NR = 0b00001000;
  18.     static constexpr u8 ST0_HD = 0b00000100;
  19.     static constexpr u8 ST0_US1 = 0b00000010;
  20.     static constexpr u8 ST0_US0 = 0b00000001;
  21.  
  22.     static constexpr u8 ST1_EN = 0b10000000;
  23.     static constexpr u8 ST1_DE = 0b00100000;
  24.     static constexpr u8 ST1_OR = 0b00010000;
  25.     static constexpr u8 ST1_ND = 0b00000100;
  26.     static constexpr u8 ST1_MA = 0b00000001;
  27.  
  28.     static constexpr u8 ST2_CM = 0b01000000;
  29.     static constexpr u8 ST2_DD = 0b00100000;
  30.     static constexpr u8 ST2_WC = 0b00010000;
  31.     static constexpr u8 ST2_BC = 0b00000010;
  32.     static constexpr u8 ST2_MD = 0b00000001;
  33.  
  34.  
  35.     static constexpr u8 ST3_FT = 0b10000000;
  36.     static constexpr u8 ST3_WP = 0b01000000;
  37.     static constexpr u8 ST3_RY = 0b00100000;
  38.     static constexpr u8 ST3_T0 = 0b00010000;
  39.     static constexpr u8 ST3_TS = 0b00001000;
  40.     static constexpr u8 ST3_HD = 0b00000100;
  41.     static constexpr u8 ST3_US1 = 0b00000010;
  42.     static constexpr u8 ST3_US0 = 0b00000001;
  43.  
  44.     u8 Data[9];
  45.     u8 *Result[7];
  46.  
  47.     u8 Msr = MSR_RQM;
  48.  
  49.     u8 St0 = 0;
  50.     u8 St1 = 0;
  51.     u8 St2 = 0;
  52.     u8 St3 = 0;
  53.  
  54.     // ╘шчшўхёъшх ярЁрьхЄЁ√
  55.     u8 pc[4]{ };
  56.     u8 ph[4]{ };
  57.     u8 pr[4]{ };
  58.  
  59.     // ╦юушўхёъшх ярЁрьхЄЁ√
  60.     u8 c = 0;
  61.     u8 h = 0;
  62.     u8 r = 1;
  63.     u8 n = 2; // 512b
  64.  
  65.     u8 eot = 0;
  66.  
  67.     unsigned CmdLen = 0;
  68.     unsigned DataPtr = 0;
  69.  
  70.     unsigned ResultLen = 0;
  71.     unsigned ResultPtr = 0;
  72.  
  73.     unsigned DataLen = 0;
  74.     unsigned MaxDataLen = 0;
  75.     bool ReadData = false;
  76.  
  77.     struct FDD *SelDrive;
  78.  
  79.     TUpd765();
  80.     void out(u8 data);
  81.     u8 in(u8 port);
  82.  
  83.     u8 ReadDataReg();
  84.  
  85.     void load();
  86.     void seek(SEEK_MODE SeekMode = JUST_SEEK);
  87. };
  88.  
  89. extern TUpd765 Upd765;
  90.