A9VG电玩部落论坛

 找回密码
 注册
搜索
查看: 13702|回复: 21

XBOX初代用XBOX360无线手柄开源方案-ogx360制作教程

[复制链接]

精华
0
帖子
4505
威望
0 点
积分
4723 点
种子
511 点
注册时间
2009-1-25
最后登录
2024-5-4
 楼主| 发表于 2019-3-20 18:10  ·  广西 | 显示全部楼层 |阅读模式
本帖最后由 can201 于 2019-3-21 09:58 编辑

先放一张成品图,等下更新教程。

这里是展示插图1

感谢国外网友Ryzee119的无私分享
项目地址:https://github.com/Ryzee119/ogx360
项目成品视频演示:https://youtu.be/ycZjQUjz1Fk


本教程经由项目开源地址github分享的英文教程翻译制作,并结合本人制作过程中总结的经验,对部分内容做了小小的修改。

ogx360 的产品介绍:

The ogx360 is a small circuit board which allows you to use Wireless Xbox 360 Controllers via an Xbox 360 Wireless Receiver on the Original Xbox Console.

ogx360是一个小小的电路板,能让你的xbox360无线手通过XBOX360无线手柄的PC接收器与初代XBOX主机相连接

这里是产品图片1

主要功能:

Support up to 4 Xbox Wireless Controllers using a modular design with readily available Arduino Pro Micro boards. I have linked Sparkfun but any cheaper clone will work the same.
支持至多4个xbox无线手柄通过Arduino Pro Mini模块实现连接,即使是组装的Arduino模块同样支持。

Full Rumble Pak support on all controllers.
支持完整的手柄震动功能。

Steel Battalion controller support on Player 1 with an Xbox 360 Chatpad using Xbox 360 Wireless Controllers.
第一号手柄插口支持《钢铁雄狮》那个惊人的“手柄”,利用xbox360手柄附带的小键盘实现该“手柄”的全部操作。

Firmware can be updated over USB. No programming hardware is required. See Firmware for programming instructions.
固件可以通过Arduino的USB进行升级,不需要额外的编程器。详细见固件刷写介绍。

Low level programming with minimal input lag. Less than 4ms over an original controller. (See https://youtu.be/V7Pnba7Y12Y)
低级程序实现了最小的输入延迟,与原装手柄相比,仅仅延迟了4ms而已。(详细见视频:https://youtu.be/V7Pnba7Y12Y

100% USB Bus powered from the Original Xbox controller ports. No requirement for external power supplies.
完全从xbox主机手柄插口(XBOX主机的手柄插口其实就是一种特制的USB插口)供电,不需要额外的供电设备。

Basically instant boot up time so you can use controllers straight away from power on.
开机立即启动。

To connect to the OG Xbox you will need an Xbox to USB adaptor, and a short microUSB cable.
与xbox主机间通过一根特制的USB线连接,可以用xbox手柄转U盘的那种线(建议线长25cm内),再配一个USB公转MicroUSB公的转化头即可。

I can't claim 100% compatibility; however, I haven't found a game that doesn't work. If you find one, let me know and I'll see if I can work it out.
不敢妄言100%兼容,但是目前测试的游戏均表现良好,如果使用者发现有不兼容的游戏,请告诉开发者Ryzee119。可以到他的***留言。

Supports Genuine Microsoft Xbox 360 Wireless Receivers (USB_VID 0x045E, USB_PID 0x0719) , Mad Catz Receivers (USB_VID 0x1BAD, USB_PID 0x0719) and Generic Third Party Wireless Receivers (USB_VID 0x045E, USB_PID 0x0291).

支持原装的PC无线接收器(可在“设备与打印机”下查看硬件ID:USB_VID 0x045E, USB_PID 0x0719,要装了微软的官方配套软件才能看到),也支持祖国版的PC无线接收器(可在“设备与打印机”下查看硬件ID:USB_VID 0x045E, USB_PID 0x0291)
原装与祖国版的外形与使用区别这里有介绍:https://www.s-config.com/archive ... r-win-xp-and-win-7/

Wired controllers are not supported by default. See the Alternative Firmware for Xbox One Wired and Xbox 360 Wired Controllers. These are considered BETA.
有线手柄默认不支持,但是有考虑提供给XBOXone有线手柄和XBOX360有线手柄的专属固件。

《钢铁雄狮》控制器的默认设置:

这里是设置插图1

Github项目下的文件目录

Hardware  This folder contains the schematic and PCB layout files. These were created using Autodesk Eagle 9.2.2.
Hardware  该目录包含了全套电路原理图和PCB设计图,基于Autodesk Eagle 9.2.2设计完成

Firmware         This folder contains the source code. The source code is based on the USB Host Shield Library for Arduino,
固件         该目录包含了固件的源代码和已编译好的固件

一个PCB可以支持四个无线手柄

You can support up to 4 players with the addition of low cost Arduino Modules such as this.
买上4个廉价的Arduino模块就行了(×宝20包邮/个的就可以)

This requires some basic soldering to solder the module into the respective port on the ogx360. Once the module is in place, you must program the correct firmware onto the device as per the instructions in Firmware. For Player 2, 3 and 4 modules you will want to use the slave hex file. Finally, connect a corresponding cable between the Arduino Module and the OG Xbox Controller Port!
需要把各个Arduino模块焊接到ogx360的PCB上对应位置,并刷写正确的固件。1号位用Mater固件,2、3、4号位置用Slave固件。各Arduino模块分别与对应的主机手柄插口相连。

工作方式

The USB Host Controller is a MAX3421 and uses the USB Host Shield Library. This enumerates and gathers data from the Xbox 360 Wireless Receiver.
从XBOX360无线手柄PC接收器接收信号。

This data is then converted into the correct format for the Original Xbox and sent to the USB device controllers. The USB device controllers use Atmega32U4 chips based on the Arduino Pro Micro. Up to four Arduino Pro Micro's can be installed either directly soldered in or installed on female sockets to support up to four players. The USB device controllers have been configured to appear as Original Xbox Controllers (or the Steel Battalion Controller) and trick the console into thinking a real controller is connected.
把信号转换成初代XBOX的格式,再经由Arduino上面的Atmega32U4 处理后传输到主机。Arduino可以直接焊接在ogx360的PCB上,也可以通过一组排座(每个模块单排12P×2)直接插在ogx360的PCB上(建议用后者,可以根据自己的实际需要,方便的增减无线手柄),Arduino通过硬件欺骗,让XBOX主机误以为连接的Arduino是一个真实的手柄。

这里是使用图1

这里是使用图2

图片中仅仅安装了两个Arduino模块,可共两个xbox360无线手柄使用。

根据提供的设计图和BOM采购对应的原件,焊接组装完成后即可进入Arduino的固件刷写环节。

都是贴片原件的焊接,没多大的难度。需要注意的是,BOM给出的晶振是4脚的12MHz无源晶振,不要买成有源的就对了。

ogx360固件刷写流程

首先简单介绍下各个固件的功能:

ogx360_32u4_master.hex

This is the default MASTER device firmware. This is the recommended firmware and contains support for 4 x Xbox 360 Wireless Controllers and Steel Battalion controller emulation (Player 1 only) with an Xbox 360 chatpad.
这个是默认的第1号位置手柄的固件,不管有几个Arduino模块,Player 1位置的Arduino都必须刷这个固件。该固件同时包含了《钢铁雄狮》控制器的支持。

ogx360_32u4_slave.hex

This is the default SLAVE device firmware. This must be programmed onto all the SLAVE modules (Player 2,3 and 4) if installed.
这个是默认的第2号、第3号、第4号位置手柄的固件,如果ogx360安装了两个及两个以上的Arduino模块,那么Player2 、Player3、Player4上的Arduino就必须刷这个固件。

ogx360_32u4_master_wired360_one.hex

Program this to the MASTER device only. This adds support for WIRED Xbox One and WIRED Xbox 360 Controllers. To connect more than one controller you must use an externally powered USB 2.0 Hub and it probably only works reliably with Genuine controllers. This still supports Wireless Xbox 360 controllers but does NOT support Steel Battalion controller emulation at all. You should have a battery installed even if wired This should be considered experimental software.
有线XBoxone和有线xbox360手柄用的固件,需要额外供电,不推荐搞。

ogx360_debug.hex

This is purely a test/debug firmware. Program this on the MASTER device to test your PCB if you have built one yourself. See instructions under Testing below.
这个固件的作用仅仅是测试ogx360的功能是否正常,刷写了这个固件的ogx360在与PC连接后,可在PC上看到一段反馈的数据,得知ogx360是否正常工作。

固件刷写操作流程:

Place the Arduino Pro Micro Leonardo board into the ogx360 PCB slot you want to use.
根据需要把Arduino插到ogx360主板的对应位置。

Download and extract avrdude to a working folder.
下载并解压缩刷写程序avrdude 到指定位置。

Download libusb0.dll and place it in the avrdude working folder.
下载对应的驱动文件libusb0.dll,并把该文件放到avrdude的目录下。

Download the correct hex file from this repository or the one compiled yourself and place it in the avrdude folder. The folder should have an avrdude.conf, avrdude.exe, libusb0.dll and the hex files. See the 'Alternate Firmware' folder for some other firmware options. Note that each module must be programmed individually, also the slave devices (player 2,3 and 4) must use the slave hex file. The master (player 1) must use the master hex file.
下载对应的Arduino固件,并将该固件放到avrdude的目录下。avrdude的目录应该包括以下几个文件 avrdude.conf、avrdude.exe、 libusb0.dll、ogx360_32u4_master.hex、ogx360_32u4_slave.hex。特别提示:ogx360_32u4_master.hex是给Player1位置的Arduino刷写用的,ogx360_32u4_slave.hex是给Player2、3、4位置的Arduino刷写用的,不要搞错。

这里是avrdude的目录文件图

Connect the respective board you want to update into the USB port on the PC.
把要刷写的Arduino的USB与PC的USB相连。

If you're having issues with avrdude, you can try installing the latest version of the Arduino IDE which contains all the relevant drivers and try running avrdude again after installation.
如果你插入Arduino后,“设备与打印机”的设备图标是带问号的,那么说明你的PC缺少Arduino设备的驱动程序,可以安装一个Arduino IDE开发工具包,会连带安装Arduino的设备驱动。也可以直接右键属性,更新驱动,直接找到Drivers文件夹安装Arduino的设备驱动。装好驱动后才能继续下面的刷写流程。

Press the RESET button located on the ogx360 PCB. The programming bootloader should initialise and enumerate itself as a COM Port.
按下ogx360上面的Reset四脚微动,在PC上的“设备与打印机”下会看到一个Arduino Leopard bootloader(COM17)的设备出现(注意图中设备的COM编号是17)。

Check which COM Port the device takes from your Device Manager. Note: The bootloader is only active for a handful of seconds so if you're too slow just press RESET again.
记下你自己设备的COM编号,如果你的现实是COM6,那么你自己的COM编号就是6,以此类推。注意,这个bootloader显示的时间仅仅有几秒,如果没来得急看,就重新按一遍Reset就会重新出现了。

这里是“设备与打印机”下显示的设备名称和COM编号图

Once the COM Port number has been determined, edit COM17 and ogx360_32u4_master.hex in the below command to suit your requirements. i.e. if you're programming a slave device ogx360_32u4_master.hex should be modified to ogx360_32u4_slave.hex
在你记下自己Arduino对应的COM编号后,根据对应的COM编号、对应的固件名称修改接下来的软件命令。

Press the RESET button again to restart to bootloader and run the following command from the avrdude directory: avrdude -C avrdude.conf -F -p atmega32u4 -c avr109 -b 57600 -P COM17 -Uflash:w:ogx360_32u4_master.hex:i.
win7系统-PC上的操作过程如下,这里先把之前准备好的Avrdude文件夹(就是avrdude-6.3-mingw32文件夹)放到D盘目录下。
文件夹的地址:D:\avrdude-6.3-mingw32
开始-搜索程序和文件-“CMD“   回车,弹出一个窗口。

窗口内输入:
CD D:\avrdude-6.3-mingw32 回车
接着输入:
avrdude -C avrdude.conf -F -p atmega32u4 -c avr109 -b 57600 -P COM17 -Uflash:w:ogx360_32u4_master.hex:i

注意COM17ogx360_32u4_master.hex要改成你对应的COM编号和你需要刷写的固件文件名。
到此窗口输入暂时结束,不要动了,保持这个窗口为当前活动窗口

按下Reset按键,在”设备与打印机“下Arduino Leopard bootloader图标出现后,马上按下回车。
窗口内出现如下一串的命令,表示Arduino固件开始刷写。

这里是cmd.exe内的指令图

Repeat the process for any other modules you need to update.
如果有其他需要刷写固件的Arduino,就重复上述的流程。

至此,ogx360制作完成。

如何在PC上测试制作好的ogx360设备

If you have made the board yourself and want to check everything is healthy, I have added a test program ogx360_debug.hex. Program this to the master module as per the programming instructions under Programming.
对于想检验自己手活的同学,开发者特地提供了一个测试的固件ogx360_debug.hex,和之前提到的固件刷写流程一样,把这个ogx360_debug.hex固件刷到Player1位置上的Arduino内。Arduino的MicroUSB接PC,ogx360的USB接360无线手柄接收器。

The module will now appear as a keyboard and serial device in windows. Note the COM port number. See below:
这时,Arduino模块在windows下会被识别成一个串口输入键盘,在“设备与打印机”下查看对应设备的COM编号。如下图所示:

这里是测试图1

Open a serial monitoring program such as Termite, and set the following settings Baud rate: 115200, 8 Data Bits, 1 Stop Bit, Parity None, Flowing Control RTS/CTS. Once you connect to the commport, the self test should be performed. A healthy board with a Wireless Receiver connected should output the following:
打开一个监控程序,这里演示用的是Termite(下载地址:https://www.compuphase.com/software_termite.htm)设置如下:
aud rate: 115200,
8 Data Bits,
1 Stop Bit,
Parity None,
Flowing Control RTS/CTS
如果你的设备组装没有问题,固件刷写没有问题,那么你会在Termite的窗口中看到如下的信息:

这里是测试图2

好了,至此测试通过,只要把固件重新刷回到ogx360_32u4_master.hex或者ogx360_32u4_slave.hex,就可以接上主机爽了。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
该用户已被禁言

精华
0
帖子
266
威望
0 点
积分
268 点
种子
0 点
注册时间
2019-3-12
最后登录
2020-11-24
发表于 2019-3-20 18:20  ·  辽宁 来自手机 | 显示全部楼层
占楼看大佬表演

精华
0
帖子
248
威望
0 点
积分
275 点
种子
30 点
注册时间
2015-4-18
最后登录
2024-4-28
发表于 2019-3-20 19:25  ·  广东 | 显示全部楼层
占楼看大佬表演

精华
0
帖子
602
威望
0 点
积分
633 点
种子
34 点
注册时间
2011-9-27
最后登录
2024-5-4
发表于 2019-3-20 22:39  ·  台湾 | 显示全部楼层
我看得亲自收集资料实践一个看看!

求败者

游吟者Fractured Mode

精华
0
帖子
20777
威望
0 点
积分
22336 点
种子
1496 点
注册时间
2011-1-1
最后登录
2024-5-4
发表于 2019-3-20 23:05  ·  广东 | 显示全部楼层
有没有PS3用XBOX360手柄的方案

精华
0
帖子
4505
威望
0 点
积分
4723 点
种子
511 点
注册时间
2009-1-25
最后登录
2024-5-4
 楼主| 发表于 2019-3-20 23:06  ·  广西 | 显示全部楼层
devilyoh 发表于 2019-3-20 23:05
有没有PS3用XBOX360手柄的方案

没看到过,但是好像有已经商业方案了

求败者

游吟者Fractured Mode

精华
0
帖子
20777
威望
0 点
积分
22336 点
种子
1496 点
注册时间
2011-1-1
最后登录
2024-5-4
发表于 2019-3-20 23:10  ·  广东 | 显示全部楼层
can201 发表于 2019-3-20 23:06
没看到过,但是好像有已经商业方案了

有一个软件插件可以实现,但很多游戏不兼容

精华
0
帖子
305
威望
0 点
积分
312 点
种子
23 点
注册时间
2004-8-29
最后登录
2024-5-4
发表于 2019-3-20 23:59  ·  上海 来自手机 | 显示全部楼层
支持铁骑?已入键盘,拭目以待!

精华
0
帖子
409
威望
0 点
积分
441 点
种子
23 点
注册时间
2005-12-10
最后登录
2024-3-14
发表于 2019-3-21 00:29  ·  广西 来自手机 | 显示全部楼层
xbox360手柄替换xbox有线手柄,除了已知的4ms输入延迟外,还会有什么物理先天缺陷吗?

我曾经在国外网站看到一个并没有被我证实的说法,xbox初代有线手柄是有压力感应的,和PS2手柄的压力感应一样(PS2版本的GTASA就是用压力感应来控制的油门),主要是A、B、X、Y四个按键带压力感应。xbox360手柄取消了压感的设计。但是我并没有遇到使用了压力感应的xbox游戏,所以,这个问题还想请知道的人指点一下
     关于这个我至少知道有3个游戏是支持压感的合金装备二,忍龙黑,DOA沙滩排球。核金装备,你轻放下X键不会开枪。缺少压感的话,估计就是直接打枪

精华
0
帖子
169
威望
0 点
积分
187 点
种子
0 点
注册时间
2017-9-13
最后登录
2020-11-24
发表于 2019-3-21 01:23  ·  广东 | 显示全部楼层
支持支持                  。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|A9VG电玩部落 川公网安备 51019002005286号

GMT+8, 2024-5-4 20:11 , Processed in 0.197540 second(s), 17 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部