gyo

Revision:
6:da71294502ee
Parent:
5:a4a994824c96
Child:
7:30e05998769b
diff -r a4a994824c96 -r da71294502ee SBDBT.cpp
--- a/SBDBT.cpp	Mon May 08 07:50:22 2017 +0000
+++ b/SBDBT.cpp	Sun Aug 13 03:35:38 2017 +0000
@@ -66,6 +66,16 @@
         }
     }
     
+    int SBDBT::sw()
+    {
+        return data[1]+data[2]<<8;
+    }
+    
+    void SBDBT::print()
+    {
+        printf("%3d %3d %3d %3d %3d %3d %3d %3d\n",data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7]);
+    }
+    
     char SBDBT::maru()
     {
         if(data[2] & 64)
@@ -150,28 +160,50 @@
         return 0;
     }
     
-    char SBDBT::rs_x()
+    signed char SBDBT::rs_x()
+    {
+        return data[5]-64;
+    }
+    
+    signed char SBDBT::rs_y()
     {
-        return data[5];
+        return data[6]-64;
+    }
+    
+    signed char SBDBT::ls_x()
+    {
+        return data[3]-64;
     }
     
-    char SBDBT::rs_y()
+    signed char SBDBT::ls_y()
     {
-        return data[6];
+        return data[4]-64;
+    }
+    
+    char SBDBT::rs_x_check()
+    {
+        return data[5]==data[5] ? 0 : 1;
     }
     
-    char SBDBT::ls_x()
+    char SBDBT::rs_y_check()
     {
-        return data[3];
+        return data[6]==data[6] ? 0 : 1;
     }
     
-    char SBDBT::ls_y()
+    char SBDBT::ls_x_check()
     {
-        return data[4];
+        return data[3]==data[3] ? 0 : 1;
+    }
+    
+    char SBDBT::ls_y_check()
+    {
+        return data[4]==data[4] ? 0 : 1;
     }
     
     SBDBT::~SBDBT()
     {
         delete sr;
+        delete tmp;
+        delete data;
     }
 }//namespace
\ No newline at end of file