AVR Megatris 2 / Megatris JAMMA

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: AVR Megatris 2 / Megatris JAMMA

Post by DaveyPocket »

Let me clear some things up, there seems to be some confusion:

All inputs on the JAMMA harness are connected to the 4021 pins. Here is a simple map of the pinout (I'm working on a more illustrated diagram, so here's something simple):

SNES P1 --------- JAMMA Harness
Up---------------- Up P1
Down------------- Down P1
Left--------------- Left P1
Right------------- Right P1
A------------------ 1 P1
B------------------ 2 P1
X------------------ 3 P1
Y------------------ 4 P1
L bumper-------- Service
R bumper-------- Test
Start-------------- P1 Start
Select------------ P2 Start

SNES P2 --------- JAMMA Harness
Up---------------- Up P2
Down------------- Down P2
Left--------------- Left P2
Right------------- Right P2
A------------------ 1 P2
B------------------ 2 P2
X------------------ 3 P2
Y------------------ 4 P2
L bumper-------- Coin 1 \
R bumper-------- Coin 2 |- These might be switched around, I have to check.
Start-------------- Tilt
Select------------ Nothing

Mapes, if you're using your version of softswtich, there is a problem. I checked in your code that your program DOES NOT check for SNES controller player 2 inputs (In your for loop, you said "for i = 0; i < 1....". This only checks controller 0). My softswitch program should have it fixed. Re-download it here: http://uzebox.org/forums/viewtopic.php? ... =140#p7711 just to make sure. I also did not program the coin counter to increment in Megatris just yet.

For everyone: To test the coin counter in softswitch, press player 1 button 3 in the input test screen and it should pulse the coin counter line.

Mapes, as for your SD card, make sure it is inserted all the way, make sure it's not fragmented, try different cards.

Now that I think about it Mapes, with your screen flickering and SD card problems. Grab a voltmeter and measure the voltage on the +12v lead on the JAMMA board and measure the power going into the ATmega644. I've had flickering screen problems caused by over-voltage...

And codecrank, I'm not quite sure I understand what you're saying, but all inputs are connected to 4021 in some way.
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: AVR Megatris 2 / Megatris JAMMA

Post by mapes »

DaveyPocket wrote:I checked in your code that your program DOES NOT check for SNES controller player 2 inputs (In your for loop, you said "for i = 0; i < 1....". This only checks controller 0).
I was pretty sure I goofed something up in my code since the games worked fine, but my program did not.
Mapes, as for your SD card, make sure it is inserted all the way, make sure it's not fragmented, try different cards.

Now that I think about it Mapes, with your screen flickering and SD card problems. Grab a voltmeter and measure the voltage on the +12v lead on the JAMMA board and measure the power going into the ATmega644. I've had flickering screen problems caused by over-voltage...
The interesting thing about the SD card is that it works most of the time. Ocasionally the SD card though freaks out. I've loaded some games perfectly fine, and at other times I get a jumbled mess a few seconds into the game (This happened when playing BC Dash).

I'll take a look at the voltage and see if it is a solid +12volts, but I'm still a little puzzled why the voltage regulator would not hold it at 5 volts regardless of the input voltage. The regulator is designed to operate between a 7 to 25 volt input.

-Mapes
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: AVR Megatris 2 / Megatris JAMMA

Post by uze6666 »

And codecrank, I'm not quite sure I understand what you're saying, but all inputs are connected to 4021 in some way.
I think that what he meant is how to use equivalent of the SNES shoulder buttons in a game. Obviously, since they map to Test and Service (which I assume are inside the cabinet right?), they can't be used for game play. So Megatris JAMMA should be tweaked to remap the "hold block" function from the R-Shoulder to X or Y button.

-Uze
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: AVR Megatris 2 / Megatris JAMMA

Post by DaveyPocket »

uze6666 wrote:
And codecrank, I'm not quite sure I understand what you're saying, but all inputs are connected to 4021 in some way.
I think that what he meant is how to use equivalent of the SNES shoulder buttons in a game. Obviously, since they map to Test and Service (which I assume are inside the cabinet right?), they can't be used for game play. So Megatris JAMMA should be tweaked to remap the "hold block" function from the R-Shoulder to X or Y button.

-Uze
Ahh, now I understand. Yes, I'm going to be totally re-mapping controls for Megatris. I'll work on that tonight and post the files.
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: AVR Megatris 2 / Megatris JAMMA

Post by DaveyPocket »

Milestone 2 posted at the thread's first post: http://uzebox.org/forums/viewtopic.php?f=3&t=1044#p7766

Try that.
User avatar
codecrank
Posts: 66
Joined: Sun Nov 16, 2008 10:13 pm
Location: Denver, Co

Re: AVR Megatris 2 / Megatris JAMMA

Post by codecrank »

:oops: should have checked the wiki.
Milestone 2 posted at the thread's first post: viewtopic.php?f=3&t=1044#p7766
:D Megatris Jamma Milestone 2 works perfect !! Thanks for the remapping !

Other cool features I can think of , in case you feel like adding more.
- credit counter
- service button brings up the megatris options menu that used to be available from the main menu.
- maybe add a dot cloth to the options menu
- ability to interrupt a 1 player game when player 2 hits start ( given available credits ) . Although this is not an issue until AI is implemented.

Thanks for your work
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: AVR Megatris 2 / Megatris JAMMA

Post by DaveyPocket »

codecrank wrote: Other cool features I can think of , in case you feel like adding more.
- credit counter
- service button brings up the megatris options menu that used to be available from the main menu.
- maybe add a dot cloth to the options menu
- ability to interrupt a 1 player game when player 2 hits start ( given available credits ) . Although this is not an issue until AI is implemented.

Thanks for your work
I was planning on adding those things :lol:

Dot cloth??

The service menu sounds interesting, I was planning to add those options in the game DIP switches and have it configured through softswitch.
User avatar
codecrank
Posts: 66
Joined: Sun Nov 16, 2008 10:13 pm
Location: Denver, Co

Re: AVR Megatris 2 / Megatris JAMMA

Post by codecrank »

you know, the test pattern used to do convergence adjustments and such.

Image

that actually may make more sense to put in softswitch... dunno. ;)
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: AVR Megatris 2 / Megatris JAMMA

Post by DaveyPocket »

I'm experimenting with the scoring system right now. I found several scoring tables such as the ones mentioned at http://tetris.wikia.com/wiki/Scoring. I think I may use one of those.
User avatar
mapes
Posts: 174
Joined: Sun Feb 13, 2011 7:04 am
Location: Seattle

Re: AVR Megatris 2 / Megatris JAMMA

Post by mapes »

Is the source code for Megatris Jamma available?

I FINALLY got a different empty cabinet and hooked up everything and it worked without a hitch. No flicker, no noise. I thought I'd check out the code and update a few bugs that I find. I noticed that my 2nd coin chute doesn't register my coin, so I wanted to look into it.

Also, I was thinking about how hard it would be to implement some tetris AI for 1 player game.

I was looking at this: http://luckytoilet.wordpress.com/2011/0 ... algorithm/ and it spells out how to make a decent using weighted value.

Looks like I'll have to finish a few of my projects...

-Mapes
Post Reply