Getting started with KADE software sources...

Re: Getting started with KADE software sources...

Postby PL1 » Fri Feb 17, 2017 8:31 pm

johnnygal wrote:As bootsector seems to have already modified some "kade-like" source for the XboxPadMicro, I wonder why this hasn't already been integrated into the kade loader. I feel as though I'm re-inventing the wheel a little. Maybe it's Jon that did the loader program, as some of the python source has his name at the top.

Thanks for documenting what you've found, Johnnygal. :D

It is really helpful for guys like me who are interested in tinkering but lack sufficient coding skills to track down where the various settings are stored.

Jon wrote the original Loader (and Mapper for miniConsole+?) in Python.

Bruno has completely rewritten Mapper for miniArcade 2.0 in C++.

I've been encouraging him to find a way to make the miniArcade 2.0 firmware usable on boards with bootloaders that won't work with Mapper.


Scott
User avatar
PL1
poster
 
Posts: 544
Joined: Tue Oct 30, 2012 5:20 am
Location: Omaha, NE

Re: Getting started with KADE software sources...

Postby johnnygal » Sun Feb 26, 2017 6:08 pm

Ok, here's a summary of the changes I made to produce a custom xbox firmware for running on the Arduino Micro (atmega32u4).

Note that my pinout image is different than that in the BYOAC XboxPadMicro thread. The pins PF3 and PF2 on the XboxPadMicro image are actually PF1 and PF0 respectively on my Micro.
Also the pins PD3 and PD2 on the XboxPadMicro image are transposed on my Micro. Looking at the source code Bruno has on github for the XboxPadMicro, it appears he is actually using the pinouts as per this image here, matching the Micro I have here.
So I'm not sure if there are variants of the Micro out there which have these differences. So if anyone uses this firmware and finds that the connections to these pins don't appear to be behaving properly, it might be due to this.
Also note that I had to skip using PC6 as on my Micro it appears connected in some way to PC7. Whenever I grounded either of these pins, both PC6 and PC7 together would go low - weird. This also happened when running the XboxPadMicro firmware, so it looks like it's my board.

With the Minicade 2.0 being developed, and with the XboxPadMicro firmware being available, it may be that no-one has the need for this Kade xbox firmware but I'll post the details and hex anyway, should anyone want to try it.



SHARED DIRECTORY:
Redefine AVR Ports in use.
state.c - current state of each pin is read.
outputs.c and showleds.c - used if using an led to denote shift function/power. Not used in this configuration

Redefine configuration of AVR pins to xbox functions.
generic_main_init.c
Rather than reading in configuration from first 69 bytes (using read_eeprom_byte), hardcode functions required into ass() array.
For e.g. if you want DPad Up for kad pin A1 (PC7 in this configuration), see ass(0) to the code 1 - see list below.
/* Function codes for xbox
1 Dpad Up
2 Dpad Down
3 Dpad Left
4 Dpad Right
5 A Button
6 B Button
7 X Button
8 Y Button
9 Left Trigger
10 Right Trigger
11 Black
12 White
13 Start
14 Back
15 Left Thumb
16 Right Thumb
17 L/Analog Up
18 L/Analog Down
19 L/Analog Left
20 L/Analog Right
21 R/Analog Up
22 R/Analog Down
23 R/Analog Left
24 R/Analog Right
25 Exit Game
26 Exit to Dashboard- (Combination of Left Trigger, Right Trigger, Back and Black)
27 Invert Analog Y Axis
28 Dpad Restrict 4-Way
29 Dpad Restrict 2-Way X
30 External Shift LED*
31 External +V power*
32 Dpad Restrict 2-Way Y
33 Auto Fire - A Button
34 Auto Fire - B Button
35 Auto Fire - X Button
36 Auto Fire - Y Button

*/

Modify bootloader start address for atmega32u4
jump.c
#define BOOTLOADER_START_ADDRESS 0x3800


XBOX-CUSTOM DIRECTORY:
main.c - Add in setup of ports E and F (copy setup of ports B, C and D)
makefile:
MCU = atmega32u4
ARCH = AVR8
BOARD = LEONARDO

MyArduinoMicroSM.png


(Just tried adding the hex as an attachment but it won't let me use that extension - if anyone wants it, let me know)
Edit: Now attached as a zip file.

Have fun!

John
You do not have the required permissions to view the files attached to this post.
Last edited by johnnygal on Sun Feb 26, 2017 7:41 pm, edited 1 time in total.
johnnygal
poster
 
Posts: 19
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby PL1 » Sun Feb 26, 2017 6:58 pm

johnnygal wrote:Just tried adding the hex as an attachment but it won't let me use that extension

You can post it in a .zip file. :D


Scott
User avatar
PL1
poster
 
Posts: 544
Joined: Tue Oct 30, 2012 5:20 am
Location: Omaha, NE

Re: Getting started with KADE software sources...

Postby johnnygal » Sun Feb 26, 2017 7:41 pm

Aha, thanks Scott.

Post updated.
johnnygal
poster
 
Posts: 19
Joined: Sat Apr 27, 2013 4:24 pm

Previous

Return to Sources - software

Who is online

Users browsing this forum: No registered users and 1 guest

cron