Commits

a1ex committed 70af22a

5Dc: decoded main dial / sub dial events :)

Comments (0)

Files changed (4)

platform/5DC.111/gui.c

     }
 }
 
+int my_bindGUISwitchCBR(int a, int b, int c, int d)
+{
+    if (a == 133 && gui_menu_shown())
+    {
+        int x = (int)((int8_t)b);
+        while (x > 0)
+        {
+            fake_simple_button(BGMT_WHEEL_RIGHT);
+            x--;
+        }
+        while (x < 0)
+        {
+            fake_simple_button(BGMT_WHEEL_LEFT);
+            x++;
+        }
+        return 0;
+    }
+    
+    
+    return bindGUISwitchCBR(a,b,c,d);
+}
+
 void hijack_gui_main_task()
 {
     //~ taskptr will point to the location of GuiMainTask's task struct.
     //~ start our GuiMainTask.
     task_create("GuiMainTask", 0x17, 0x2000, my_gui_task, 0);
 
+    //~ also hijack my_bindGUISwitchCBR - to decode top vs bottom wheel
+    MEM(0xF654) = my_bindGUISwitchCBR;
+
     give_semaphore(MEM(0x12720));
 }

platform/5DC.111/gui.h

 // dummy
 #define BGMT_PRESS_HALFSHUTTER -12345
 #define BGMT_UNPRESS_HALFSHUTTER -12345
-#define BGMT_WHEEL_LEFT -123456
-#define BGMT_WHEEL_RIGHT -1234567
+#define BGMT_WHEEL_LEFT 123456
+#define BGMT_WHEEL_RIGHT 1234567
 #define BGMT_UNPRESS_SET -123456789
 #define GMT_GUICMD_OPEN_SLOT_COVER -12345678
 #define GMT_GUICMD_START_AS_CHECK -12345678

platform/5DC.111/stubs.S

 NSTUB(0xffb08e34, EnableBitmapVBufferForPlayBackAndWaiting)
 NSTUB(0xffb09ea8, BmpDDev_give_semaphore)
 NSTUB(0xffb09e84, BmpDDev_take_semaphore)
+
+NSTUB(0xff814618, bindGUISwitchCBR)
                     }
                     else
                     {
+                        #ifdef CONFIG_5DC
+                        STR_APPEND(msg, "Main Dial: ");
+                        #else
                         STR_APPEND(msg, "Left/Right: ");
+                        #endif
                     }
                     if (icon_drawn == MNI_ACTION)
                     {