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: 653
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: 28
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: 653
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: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Mon Apr 10, 2017 5:28 pm

johnnygal wrote:Yep, MaxRod gave me a price for a few minimus which was reasonable but as I am in the UK the shipping cost is prohibitive. So I thought I'd look at alternative options.


Had i known you were actually planning to do development on the minimus, i would have had some sent to you at no cost. Still looking for someone to fix the extended mode bug too.

Dwill/MaxRod
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby PL1 » Mon Apr 10, 2017 6:09 pm

dwill wrote:Still looking for someone to fix the extended mode bug too.

Bad news: Not sure if/when Jon will show up again so the extended mode bug is in Limbo for now. :(

Good news: miniArcade 2.0 is very close to beta release. (uses a 32u4 AVR)

It has 24 Normal inputs and 23 Shifted inputs so it can easily take the place of extended mode.

A standard MAME 2-player setup (Joy + 6-buttons + Coin + Start) with two admin buttons (ESC + Pause) uses 26 inputs -- the default layout has shifted functions on P1 Start and P2 Start.


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

Re: Getting started with KADE software sources...

Postby johnnygal » Thu Apr 13, 2017 4:27 pm

dwill wrote:
johnnygal wrote:Yep, MaxRod gave me a price for a few minimus which was reasonable but as I am in the UK the shipping cost is prohibitive. So I thought I'd look at alternative options.


Had i known you were actually planning to do development on the minimus, i would have had some sent to you at no cost. Still looking for someone to fix the extended mode bug too.

Dwill/MaxRod

Hi Dwill/MaxRod,

I was after the minimus to avoid having to do any development :D. As I couldn't locate any, I began modifying the sources for a pro micro (32u4 chip), so I could continue to use low-cost easily available hardware for my future encoders.

Regards,
John
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Sat Apr 15, 2017 1:21 pm

johnnygal wrote:
dwill wrote:
johnnygal wrote:Yep, MaxRod gave me a price for a few minimus which was reasonable but as I am in the UK the shipping cost is prohibitive. So I thought I'd look at alternative options.


Had i known you were actually planning to do development on the minimus, i would have had some sent to you at no cost. Still looking for someone to fix the extended mode bug too.

Dwill/MaxRod

Hi Dwill/MaxRod,

I was after the minimus to avoid having to do any development :D. As I couldn't locate any, I began modifying the sources for a pro micro (32u4 chip), so I could continue to use low-cost easily available hardware for my future encoders.

Regards,
John


John

Since you seem to already have some know-how of AVRs. I'd be more than happy to send you some shipped to your door if you can manage to fix this bug. A simple hex uploaded publicly would suffice.
viewtopic.php?f=8&t=4123
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Mon Apr 17, 2017 4:21 pm

dwill wrote:
John

Since you seem to already have some know-how of AVRs. I'd be more than happy to send you some shipped to your door if you can manage to fix this bug. A simple hex uploaded publicly would suffice.
viewtopic.php?f=8&t=4123


I should have a little time this week so will take a look at the sources for the extended mode. Could you send me screenshots of the button configuration in kade loader you are using for the "normal" and extended mappings.

Cheers,
John
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Mon Apr 17, 2017 4:38 pm

Just reading up on this extended mode, I assume it's option:
'MAME Encoder (Extended)' available by enabling beta versions in the 'Advanced' kade loader menu option?
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Mon Apr 17, 2017 5:24 pm

johnnygal wrote:
dwill wrote:
John

Since you seem to already have some know-how of AVRs. I'd be more than happy to send you some shipped to your door if you can manage to fix this bug. A simple hex uploaded publicly would suffice.
viewtopic.php?f=8&t=4123


I should have a little time this week so will take a look at the sources for the extended mode. Could you send me screenshots of the button configuration in kade loader you are using for the "normal" and extended mappings.

Cheers,
John


I use the default mapping that is provided with the extended mode in kade loader. I never changed them around. The bug is triggered when you press player 2 button 6

johnnygal wrote:Just reading up on this extended mode, I assume it's option:
'MAME Encoder (Extended)' available by enabling beta versions in the 'Advanced' kade loader menu option?


Yes
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Mon Apr 17, 2017 6:19 pm

Do the extended mode buttons operate correctly in themselves?
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Mon Apr 17, 2017 6:38 pm

johnnygal wrote:Do the extended mode buttons operate correctly in themselves?


The bug is as follows.

Player 2 button 6 always seems to get mapped to the last utility button you hit.

For example, if you coined up a game, player 2 button 6 will be the last coin up button you used. If you hit escape then player 2 button 6 will now be escape.
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Mon Apr 17, 2017 6:56 pm

yep, I am just checking that the 3 extended mode buttons operate correctly - that they have the required action. i.e. you can add credit, p1 start and ESC operate ok.

I understand that once an extended mode button is pressed, pressed P2B6 is getting reconfigured for the same action.
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Mon Apr 17, 2017 7:24 pm

OK, I can see where the configuration for input B10 is getting overwritten after detecting an impossible button selection.

Before I make any changes and produce a hex, I have just tried building the sources 'as is' and they don't build. So I'll need to look into that first. That's me for tonight...will continue tomorrow.
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Mon Apr 17, 2017 7:34 pm

johnnygal wrote:OK, I can see where the configuration for input B10 is getting overwritten after detecting an impossible button selection.

Before I make any changes and produce a hex, I have just tried building the sources 'as is' and they don't build. So I'll need to look into that first. That's me for tonight...will continue tomorrow.


thanks Johnnygal. Very much appreciated.
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby PL1 » Tue Apr 18, 2017 1:22 am

johnnygal wrote:OK, I can see where the configuration for input B10 is getting overwritten after detecting an impossible button selection.

Outstanding! Image

Thanks for tracking down (and hopefully fixing) this bug. Image Image Image


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

Re: Getting started with KADE software sources...

Postby johnnygal » Tue Apr 18, 2017 7:22 pm

Please find attached a hex file I'm hoping has the fix for the extended mode B10 issue.

The keymappings are as per default for extended mode. (i.e. see attachment KeyMappings.jpg)

Please be aware I have no mega32u2 or 90usb162 boards so this hex has not been loaded anywhere, so use at your own risk.
You do not have the required permissions to view the files attached to this post.
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Wed Apr 19, 2017 12:54 am

johnnygal wrote:Please find attached a hex file I'm hoping has the fix for the extended mode B10 issue.

The keymappings are as per default for extended mode. (i.e. see attachment KeyMappings.jpg)

Please be aware I have no mega32u2 or 90usb162 boards so this hex has not been loaded anywhere, so use at your own risk.


I have a control panel here thats already populated. I'll wire one up in the next day or so and test it out.

In the meantime, PM me your address and how many AVRs you need. I'll get them out to you in a few days.
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Wed Apr 19, 2017 8:43 pm

I was going to suggest having one or two from you, mainly to check out updated sources before submitting back into the git repository (your fixed hex has the key mappings hardcoded into the source rather than via the loader GUI).

But seeing as though this version of Kade is essentially obsolete, with a new version of miniArcade due out shortly, I won't bother pushing the fix into main repository. So don't worry about sending over any minimus, the postage charges were quite high anyway.

I just did it for "the thrill of the chase" :D

Keep us updated on how you get on with the new firmware anyway.

Cheers.
johnnygal
poster
 
Posts: 28
Joined: Sat Apr 27, 2013 4:24 pm

Re: Getting started with KADE software sources...

Postby dwill » Thu Apr 20, 2017 2:42 am

johnnygal wrote:I was going to suggest having one or two from you, mainly to check out updated sources before submitting back into the git repository (your fixed hex has the key mappings hardcoded into the source rather than via the loader GUI).

But seeing as though this version of Kade is essentially obsolete, with a new version of miniArcade due out shortly, I won't bother pushing the fix into main repository. So don't worry about sending over any minimus, the postage charges were quite high anyway.

I just did it for "the thrill of the chase" :D

Keep us updated on how you get on with the new firmware anyway.

Cheers.


I gave the hex a quick test and it seems to work 100%. My setup looks like a rats nest so I'll tidy it up and give it an extra test tomorrow. Thanks so much for the fix and again, if you happen to want a few for whatever reason I'm more than willing to ship you some for your troubles.
dwill
poster
 
Posts: 15
Joined: Fri Dec 04, 2015 5:39 pm

Re: Getting started with KADE software sources...

Postby johnnygal » Fri Apr 21, 2017 11:56 am

That's good to hear.
johnnygal
poster
 
Posts: 28
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