Switch硬體外掛完成 - Switch
By Sierra Rose
at 2018-01-24T00:34
at 2018-01-24T00:34
Table of Contents
※ 引述《wayne30349 (怪人)》之銘言:
: 本版是NS板,發文討論者請注意
: 01. 全面禁止改機文與盜版討論
: 任何盜版徵求、模擬器、改機討論嚴格禁止
: 非官方NFC卡及Amiibo也視同盜版.
: 相關文章將視情況給予退文或水桶30天起。
: ----------------------------------------------------
: 先聲明,此為外部設備,就像是拿轉接頭把PS4搖桿轉成Switch一樣的方式
: 也就是修改USB HID的內容
: 並非硬體改機,也不是軟體改機,最簡單的說法是自己寫搖桿
: 前情提要
: https://forum.gamer.com.tw/C.php?bsn=31587&snA=4622&tnum=1
: 前幾天是照抄Hori搖桿的描述符,但是發現一動也不動...
: 不過後來搜尋到國外大神把描述符給寫好了
: 後來才發現,原來PC端跟Switch端有些不同
: https://github.com/shinyquagsire23/Switch-Fightstick/blob/master/HORI_Descriptors
: 於是花一個小時改寫一下Code
: 目前是完成了
: https://www.youtube.com/watch?v=R3k4lsuIvaU
: uint8_t buf_standby[8] ={0x00,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//待命
: uint8_t buf2_up[8] ={0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//上
: uint8_t buf2_down[8] ={0x00,0x00,0x04,0x80,0x80,0x80,0x80,0x00};//下
: uint8_t buf2_left[8] ={0x00,0x00,0x06,0x80,0x80,0x80,0x80,0x00};//左
: uint8_t buf2_right[8] ={0x00,0x00,0x02,0x80,0x80,0x80,0x80,0x00};//右
: uint8_t buf3_L[8] ={0x10,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//L
: uint8_t buf3_R[8] ={0x20,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//R
: uint8_t buf3_LR[8] ={0x30,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//L+R
: uint8_t buf3_A[8] ={0x04,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//A
: uint8_t buf3_B[8] ={0x02,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//B
: uint8_t buf3_X[8] ={0x08,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//X
: uint8_t buf3_Y[8] ={0x01,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//Y
: 這些是按鍵的RAW值,只要我們把按鍵寫好,延遲寫好
: 就可以上班之後掛印度神劍的七冰拉
: 影片是插上之後,上下左右的模擬
今天開始嘗試寫異域神劍的自動抽神劍程式
https://www.youtube.com/watch?v=h1V95wCpCk8
倒是在按鈕上面發生一些問題
原來是在傳按鍵後,需要再傳一個待命指令
不然他會認為是按著不放,另外按鍵與按鍵需要間格一些時間(我是設定100ms)
不然會出現奇怪的錯誤
之前寫的按鍵我在這裡一併附上
uint8_t buf_standby[8] ={0x00,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//
uint8_t buf2_up[8] = {0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//上
uint8_t buf2_down[8] = {0x00,0x00,0x04,0x80,0x80,0x80,0x80,0x00};//下
uint8_t buf2_left[8] = {0x00,0x00,0x06,0x80,0x80,0x80,0x80,0x00};//左
uint8_t buf2_right[8] = {0x00,0x00,0x02,0x80,0x80,0x80,0x80,0x00};//右
uint8_t buf3_L[8] = {0x10,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//L
uint8_t buf3_R[8] = {0x20,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//R
uint8_t buf3_LR[8] = {0x30,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//L+R
uint8_t buf3_L2[8]= {0x40,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//L2
uint8_t buf3_R2[8]= {0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//R2
uint8_t buf3_A[8] = {0x04,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//A
uint8_t buf3_B[8] = {0x02,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//B
uint8_t buf3_X[8] = {0x08,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//X
uint8_t buf3_Y[8] = {0x01,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//Y
uint8_t buf3_HOME[8]= {0x00,0x10,0x0f,0x80,0x80,0x80,0x80,0x00};//HOME
int8_t buf3_capture[8]= {0x00,0x20,0x0f,0x80,0x80,0x80,0x80,0x00};//捕捉
uint8_t buf3_plus[8]= {0x00,0x02,0x0f,0x80,0x80,0x80,0x80,0x00};//+
uint8_t buf3_Minus[8]= {0x00,0x01,0x0f,0x80,0x80,0x80,0x80,0x00};//-
以下為HID敘述符
usbd_hid0_report_descriptor[] = {
HID_UsagePage(0x01),
HID_Usage ( 0x05 ),
HID_Collection ( HID_Application ),
HID_LogicalMin ( 0 ),
HID_LogicalMaxS ( 1 ),
HID_PhysicalMin ( 0 ),
HID_PhysicalMaxS (1 ),
HID_ReportSize ( 1 ),
HID_ReportCount(13),
HID_UsagePage ( 0x09 ),
HID_UsageMin(0x01),
HID_UsageMax(0x0d),
HID_Input(0x02),
HID_ReportCount(0x03),
HID_Input(0x01),
HID_UsagePage(0x01),
HID_LogicalMax(0x07),
HID_PhysicalMaxS(0x3b01),
HID_ReportSize(0x04),
HID_ReportCount(0x01),
HID_Unit(0x14),
HID_Usage(0x39),
HID_Input(0x42),
HID_Unit(0x00),
HID_ReportCount(0x01),
HID_Input(0x01),
HID_LogicalMaxS(0xff00),
HID_PhysicalMaxS(0xff00),
HID_Usage(0x30),
HID_Usage(0x31),
HID_Usage(0x32),
HID_Usage(0x35),
HID_ReportSize(0x08),
HID_ReportCount(0x04),
HID_Input(0x02),
HID_UsagePage(0x00ff),
HID_Usage(0x20),
HID_ReportCount(0x01),
HID_Input(0x02),
HID_Usage(0x2126),
HID_ReportCount(0x08),
HID_Output(0x02),
HID_EndCollection
};
另外有人問說,這跟市面上賣的n100有何不同
我個人不知道n100是否可以在電腦上寫腳本
如果不能,只能手動按手把錄影腳本的話
想一下你按七冰的任務,任務做完十分鐘後你還要再按第二次的不方便姓
或者有些並不是固定按A的遊戲
像是這個
https://unwire.hk/2017/12/04/switchjoyconpatch/game-channel/
這樣的話錄製腳本就不行了,如果是MCU自己寫,我可以在按鍵間格上
寫一些時間的公式等等
--
--
: 本版是NS板,發文討論者請注意
: 01. 全面禁止改機文與盜版討論
: 任何盜版徵求、模擬器、改機討論嚴格禁止
: 非官方NFC卡及Amiibo也視同盜版.
: 相關文章將視情況給予退文或水桶30天起。
: ----------------------------------------------------
: 先聲明,此為外部設備,就像是拿轉接頭把PS4搖桿轉成Switch一樣的方式
: 也就是修改USB HID的內容
: 並非硬體改機,也不是軟體改機,最簡單的說法是自己寫搖桿
: 前情提要
: https://forum.gamer.com.tw/C.php?bsn=31587&snA=4622&tnum=1
: 前幾天是照抄Hori搖桿的描述符,但是發現一動也不動...
: 不過後來搜尋到國外大神把描述符給寫好了
: 後來才發現,原來PC端跟Switch端有些不同
: https://github.com/shinyquagsire23/Switch-Fightstick/blob/master/HORI_Descriptors
: 於是花一個小時改寫一下Code
: 目前是完成了
: https://www.youtube.com/watch?v=R3k4lsuIvaU
: uint8_t buf2_up[8] ={0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//上
: uint8_t buf2_down[8] ={0x00,0x00,0x04,0x80,0x80,0x80,0x80,0x00};//下
: uint8_t buf2_left[8] ={0x00,0x00,0x06,0x80,0x80,0x80,0x80,0x00};//左
: uint8_t buf2_right[8] ={0x00,0x00,0x02,0x80,0x80,0x80,0x80,0x00};//右
: uint8_t buf3_L[8] ={0x10,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//L
: uint8_t buf3_R[8] ={0x20,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//R
: uint8_t buf3_LR[8] ={0x30,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//L+R
: uint8_t buf3_A[8] ={0x04,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//A
: uint8_t buf3_B[8] ={0x02,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//B
: uint8_t buf3_X[8] ={0x08,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//X
: uint8_t buf3_Y[8] ={0x01,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//Y
: 這些是按鍵的RAW值,只要我們把按鍵寫好,延遲寫好
: 就可以上班之後掛印度神劍的七冰拉
: 影片是插上之後,上下左右的模擬
今天開始嘗試寫異域神劍的自動抽神劍程式
https://www.youtube.com/watch?v=h1V95wCpCk8
原來是在傳按鍵後,需要再傳一個待命指令
不然他會認為是按著不放,另外按鍵與按鍵需要間格一些時間(我是設定100ms)
不然會出現奇怪的錯誤
之前寫的按鍵我在這裡一併附上
uint8_t buf_standby[8] ={0x00,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//
uint8_t buf2_up[8] = {0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//上
uint8_t buf2_down[8] = {0x00,0x00,0x04,0x80,0x80,0x80,0x80,0x00};//下
uint8_t buf2_left[8] = {0x00,0x00,0x06,0x80,0x80,0x80,0x80,0x00};//左
uint8_t buf2_right[8] = {0x00,0x00,0x02,0x80,0x80,0x80,0x80,0x00};//右
uint8_t buf3_L[8] = {0x10,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//L
uint8_t buf3_R[8] = {0x20,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//R
uint8_t buf3_LR[8] = {0x30,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//L+R
uint8_t buf3_L2[8]= {0x40,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//L2
uint8_t buf3_R2[8]= {0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x00};//R2
uint8_t buf3_A[8] = {0x04,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//A
uint8_t buf3_B[8] = {0x02,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//B
uint8_t buf3_X[8] = {0x08,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//X
uint8_t buf3_Y[8] = {0x01,0x00,0x0f,0x80,0x80,0x80,0x80,0x00};//Y
uint8_t buf3_HOME[8]= {0x00,0x10,0x0f,0x80,0x80,0x80,0x80,0x00};//HOME
int8_t buf3_capture[8]= {0x00,0x20,0x0f,0x80,0x80,0x80,0x80,0x00};//捕捉
uint8_t buf3_plus[8]= {0x00,0x02,0x0f,0x80,0x80,0x80,0x80,0x00};//+
uint8_t buf3_Minus[8]= {0x00,0x01,0x0f,0x80,0x80,0x80,0x80,0x00};//-
以下為HID敘述符
usbd_hid0_report_descriptor[] = {
HID_UsagePage(0x01),
HID_Usage ( 0x05 ),
HID_Collection ( HID_Application ),
HID_LogicalMin ( 0 ),
HID_LogicalMaxS ( 1 ),
HID_PhysicalMin ( 0 ),
HID_PhysicalMaxS (1 ),
HID_ReportSize ( 1 ),
HID_ReportCount(13),
HID_UsagePage ( 0x09 ),
HID_UsageMin(0x01),
HID_UsageMax(0x0d),
HID_Input(0x02),
HID_ReportCount(0x03),
HID_Input(0x01),
HID_UsagePage(0x01),
HID_LogicalMax(0x07),
HID_PhysicalMaxS(0x3b01),
HID_ReportSize(0x04),
HID_ReportCount(0x01),
HID_Unit(0x14),
HID_Usage(0x39),
HID_Input(0x42),
HID_Unit(0x00),
HID_ReportCount(0x01),
HID_Input(0x01),
HID_LogicalMaxS(0xff00),
HID_PhysicalMaxS(0xff00),
HID_Usage(0x30),
HID_Usage(0x31),
HID_Usage(0x32),
HID_Usage(0x35),
HID_ReportSize(0x08),
HID_ReportCount(0x04),
HID_Input(0x02),
HID_UsagePage(0x00ff),
HID_Usage(0x20),
HID_ReportCount(0x01),
HID_Input(0x02),
HID_Usage(0x2126),
HID_ReportCount(0x08),
HID_Output(0x02),
HID_EndCollection
};
另外有人問說,這跟市面上賣的n100有何不同
我個人不知道n100是否可以在電腦上寫腳本
如果不能,只能手動按手把錄影腳本的話
想一下你按七冰的任務,任務做完十分鐘後你還要再按第二次的不方便姓
或者有些並不是固定按A的遊戲
像是這個
https://unwire.hk/2017/12/04/switchjoyconpatch/game-channel/
這樣的話錄製腳本就不行了,如果是MCU自己寫,我可以在按鍵間格上
寫一些時間的公式等等
--
→ asship: 給了6樓的基於蛋蛋大大,不知道要扣稅,815變733 囧 10/25 21:22
推 baseonballs: 已收到 不過我的名字baseonballs是棒球4壞球保送 10/25 21:29
→ baseonballs: 的意思...不是基於蛋蛋啊 囧囧囧 10/25 21:30
--
Tags:
Switch
All Comments
By Queena
at 2018-01-25T01:13
at 2018-01-25T01:13
By Christine
at 2018-01-29T05:29
at 2018-01-29T05:29
By Eartha
at 2018-01-31T03:46
at 2018-01-31T03:46
By Quintina
at 2018-02-02T04:04
at 2018-02-02T04:04
By Edwina
at 2018-02-03T11:57
at 2018-02-03T11:57
By Robert
at 2018-02-04T12:53
at 2018-02-04T12:53
By Franklin
at 2018-02-08T15:45
at 2018-02-08T15:45
Related Posts
有關eshop數位版的區域問題
By Christine
at 2018-01-23T22:09
at 2018-01-23T22:09
巴哈要搶先實況中文版薩爾達了
By Regina
at 2018-01-23T20:21
at 2018-01-23T20:21
花枝splatoon2減輕爆風傷害技能的實用性
By Agatha
at 2018-01-23T19:54
at 2018-01-23T19:54
薩爾達傳說 中文預告
By Catherine
at 2018-01-23T18:56
at 2018-01-23T18:56
巴哈要搶先實況中文版薩爾達了
By Rebecca
at 2018-01-23T16:30
at 2018-01-23T16:30