Creating certain button sequences using autofire hacks

The place for all discussion on gaming hardware
Post Reply
BER
Posts: 394
Joined: Fri Feb 04, 2005 11:39 pm

Creating certain button sequences using autofire hacks

Post by BER »

I would like to know how to make a synchronized rapid fire device (or "auto-fire hack") output particular on-off sequences. In particular, I would like to modify the following circuit to produce these sequences:

http://galford.hp.infoseek.co.jp/sync.html

Let's denote 1 as a button being on for one frame and 0 as off. How can I produce the following sequences:
  • 100100... (that is, a cycle with one on frame followed by two off frames)
  • 111000111000... (three on, three off)
  • 1100011000... (two on, three off)
The reason why I'm interested in these sequences is that they are used to help Mushihime players earn high scores. See this thread for details:

http://click-stick.com/bbs/viewtopic.php?p=3082#3082
Bernard A. DORIA (retired)
black mariah
Banned User
Posts: 289
Joined: Mon Feb 28, 2005 5:25 am
Location: Fort Worth, Tx

Post by black mariah »

I've been considering making custom sticks geared towards shooters, with built-in autofire hacks. I'll do some digging around on a few electronics sites I know and see what I can find. Logic gates like this are fairly simple, I'm just not very familiar with their usage.

It would seem to me that to be useful, a generic autofire hack would have to have variable speed (Hz) and a switchable pattern (100100, 111000, whatever). From what little I know about timers that would be difficult, but probably doable. Time to bust out the data sheets... :lol:
Blow up self to involve enemies.
User avatar
raiden
Posts: 862
Joined: Tue Jan 25, 2005 11:41 pm
Location: Cologne
Contact:

Post by raiden »

according to the thread BER linked to, the chip is synchronized with the video signal, so it knows when a new frame starts. I´m not sure this will work with the PS2 version, however, because dealing with such delicate timing could bring the issue of input lag even on console controllers to light. The jp page was a true eye-opener, though. They even use autofire for Mr. Driller! Just with a slow rate. I have to get such a chip.
User avatar
Rastan78
Posts: 1964
Joined: Wed Jan 26, 2005 2:08 am

Post by Rastan78 »

I think Sanwa makes an autofire circuit. Seems pretty expensive though. It looks a PCB that fits over the jamma edge connector of a board then your jamma harness goes into the other end. Probably has tons of dip switches that let you change the rate and set up different configs etc. I'm not sure how these type of circuits would work with consoles considering that they use the composite sync from the jamma harness.

Yeah, it's crazy how much Japan gamers use autofire and synchronized buttons even on games where it doesn't seem immediately obvious why you would even need to do that.
black mariah
Banned User
Posts: 289
Joined: Mon Feb 28, 2005 5:25 am
Location: Fort Worth, Tx

Post by black mariah »

Interesting. Does it say that it's synced directly from the video signal, or just that it's synced to 60 FPS? I don't speak a damn bit of Japanese and machine translation has a ways to go. :lol:

I did some research on the chips.

MC14022B is an octal counter. Octal counters are used to output a binary sequence. See where this is going? http://www.play-hookey.com/digital/johnson_counter.html

The other chip is a simple NAND logic gate.

The best I can figure, you set the MC14022B to output a certain string and use the logic gate to bitchslap it into shape. I could be ENTIRELY wrong though, so don't go building shit based on my word. :lol: There's still much research to do. :wink:
Blow up self to involve enemies.
User avatar
shiftace
Posts: 435
Joined: Tue Jan 25, 2005 10:18 pm
Location: yes

Post by shiftace »

Funny, that circuit got posted here a couple months ago:

http://forum.shmups.com/forum/viewtopic.php?t=1461

I spent some time thinking about this and poking around on Google for chips, and programmable autofire looks like a fairly complicated problem. But I'm not an expert at this or anything, I know some theory but I don't go around building circuits as a hobby. Maybe some year, I will.

Sync: I think it should go to the video signal, just because separate clocks are never good for anything. If the clocks are out of sync, then you can get weird stuff like 1 frame of high input being read as 2 frames. And if the frequencies are slightly different, then you could get the 1 -> 2 effect occurring periodically, like every 4 seconds.

Edit: removed a bunch of long-winded stuff about shift registers because it's overkill... feeling a little ridiculous about it:

Now that I stop and actually read the rest of the thread... gates on the counter outputs are a good method. Or you could put a 2:1 mux on each output (other mux input is ground), connect the select line to a dip switch, and connect all the mux outputs to a big or gate. Then, you can put in any shot pattern you want with the dip switches, and it's not as hard-wired as using gates...
"Can they really get inside my head?"
"As long as you keep an open mind."
black mariah
Banned User
Posts: 289
Joined: Mon Feb 28, 2005 5:25 am
Location: Fort Worth, Tx

Post by black mariah »

shiftace: It sounds like you know a lot more about this shit than I do. My experience is with guitar-related circuits, not things like this. A basic autofire circuit is braindead simple to implement. Hook up a 555 timer and call it a day. It's the programmable aspect that's throwing me into unknown territory. :?
Blow up self to involve enemies.
User avatar
shiftace
Posts: 435
Joined: Tue Jan 25, 2005 10:18 pm
Location: yes

Post by shiftace »

If you'll pardon some ASCII graphics, here's what I'm thinking of now:

Code: Select all

              +--------+
              |Selector|
       /------| thingy |
       |      +--------+
 +-----------+ ||||||||
 |   RST   Q0|--------+------------------------------ etc.
 |         Q1|-------+------------------------------- etc.
 |MC14011  Q2|------+-------------------------------- etc.
 |         Q3|-----+--------------------------------- etc.
 |         Q4|----+---------------------------------- etc.
 |         Q5|---+---------------------------\
 |         Q6|--+---------------\            |
 |         Q7|-+---\            |            |
 +-----^-----+     |            |            |
       |           |            |            |
     SYNC        |'|          |'|          |'|
           S7 >--|  >-> A7  /-|  >-> A6  /-|  >-> A5  etc.
                 |.'        | |.'        | |.'
                            |            |
                      S6 >--/      S5 >--/
Explanation:

(I hardly ever find this stuff presented at this level of detail/simplicity, but I don't think I'm an expert, and most of the people here don't seem to be experts either. So simple is good.)

The MC14011 box should start with Q0 high and everything else low after it's reset, and each Sync pulse will cause the next numbered Q output to go high, while the others stay low. They are all connected to the "selector thingy," which should probably be a big multiplexer, so that when the correct Q input goes high, the counter resets to Q0. E.g., if the selector passes Q2 to the Reset pin, then you get 3 cycles before the counter resets. That's how the 14011 is wired according to the Japanese page, I think. Except the don't specify a "selector thingy," they just tell you to connect A to a numbered pin or some such.

The triangular things are tri-state buffers. When the side input (enable) is low, the output is disconnected from the input (high impedance). When the enable input is high, output = input. By setting the S inputs with switches, you can determine whether the A outputs will pass a 1 or a 0 when the corresponding Q enables a buffer.

So, with each Sync pulse, a different buffer is enabled, which causes either a 1 or 0 value to appear at an A line. You can connect all the A lines with a big OR gate to get a single waveform whose value at each frame is controlled by the S values. Or, even better, since only one buffer at a time is active, you can just wire all of A0-A7 together and you should get the same result. It may be a good idea to stick a 10k pulldown resistor on the output, in that case, just so you know what happens if all the buffers are inactive.

Other details:

Set up dipswitches by hanging a big resistor (10k or more) off of +5V or GND, and connect it to GND or +5V respectively through one switch. The output is at the point between the switch and the resistor. I don't think debouncing is anything to worry about here, dipswitches are seldom switched and they can't affect the counter anyway.

Nobody sells 8-input OR gates, but there is such a thing as a 13-input NAND gate, which can serve as well if you invert the right things and tie the extra inputs to some of the useful inputs.

All the resistors and caps in the original autofire circuit are probably doing some kind of bandpass filter on Sync. Except the big cap from +5 to GND, which is a power filter. It should not need to be there, but having it there can only improve things.

You could put several banks of dipswitches in the autofire circuit, to store several patterns without having to fliip dipswitches during a game (heh),
but it would take a ton of muxes. Or you could just add one of these things for every button.

I think this is a correct, reasonably compact setup, but I don't know that.

It's a safe bet that somewhere in this post, something numbered from 0-7 should be numbered from 7-0, and/or a 1 or 0 needs to be flipped.

It might be worth programming and burning a PIC to do some of this, if you know people who are into that.

Edit:

Just occurred to me shortly after posting this, as I was falling asleep. There's no need to use muxes here, making them out of tri-state buffers and inverters or anything. A single tri-state buffer on each Q line is enough. S = input, A = output, Q = enable.

Edit 2: Changed ASCII graphics and rest of post to reflect using buffers instead of muxes. Yes, I am a dork, and I have a lot of free time today.
Last edited by shiftace on Fri Jun 03, 2005 2:59 am, edited 1 time in total.
"Can they really get inside my head?"
"As long as you keep an open mind."
black mariah
Banned User
Posts: 289
Joined: Mon Feb 28, 2005 5:25 am
Location: Fort Worth, Tx

Post by black mariah »

My head asplode. :lol: I understand what you're saying. I should seriously look into digital logic a bit more. Even a simple 555 timer confuses me sometimes. :?

The PIC idea is a good one. I've thought about messing with those for a while. This gives me a good enough excuse. Microchip has an IDE that includes a built-in simulator. I think I'll play with this a bit and see what I can come up with.
Blow up self to involve enemies.
BER
Posts: 394
Joined: Fri Feb 04, 2005 11:39 pm

Post by BER »

shiftace, could you please tell me how we can use your controller (is that what your diagram represents?) to produce this sequence: 1100011000... I'm having trouble understanding your description quickly, so I hope an example will help me understand.
Bernard A. DORIA (retired)
black mariah
Banned User
Posts: 289
Joined: Mon Feb 28, 2005 5:25 am
Location: Fort Worth, Tx

Post by black mariah »

Using the circuit you posted, you tell the MC14022B to output the sequence for the number 2, which is 11000. I do not know how to actually implement this. All I know is that's how it works. Like I've said before, my knowledge of digital logic is minimal at best.
Blow up self to involve enemies.
User avatar
shiftace
Posts: 435
Joined: Tue Jan 25, 2005 10:18 pm
Location: yes

Post by shiftace »

Sorry for long delay, I have undergone some travel lately with no internet access. I'll post stuff in a day or two.
"Can they really get inside my head?"
"As long as you keep an open mind."
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

Post by ED-057 »

I'm thinking you could take the circuit from the Japanese page and add a flip-flop to the output. Then wire up a couple more gates so that A is driven high by (one of the counter outputs AND the flip-flop output) or (another of the counter outputs AND NOT the flip-flop output).

Then you could set how many frames it would be on as well as how many frames it would be off for each cycle. (Hopefully this is understandable)
User avatar
shiftace
Posts: 435
Joined: Tue Jan 25, 2005 10:18 pm
Location: yes

Post by shiftace »

Let's try this now. But please be aware that I am not in a position to test any of this stuff, so I'm basically making it up as I go.
BER wrote:shiftace, could you please tell me how we can use your controller (is that what your diagram represents?) to produce this sequence: 1100011000... I'm having trouble understanding your description quickly, so I hope an example will help me understand.
To create 11000, you need to connect Q4 to Reset, so that the counter repeats every 5 clock cycles. Then, you need to combine Q0 (10000) and Q1 (01000) to get 11000. The easiest way to do that is with an AND gate, but that isn't programmable. In order to control the output pattern using switches, you need buffers or multiplexers. Or maybe there's even a sane way using discrete transistors. More detailed ASCII:

Code: Select all

       /-----------\
       |           |
       |        /----\-----< 1
       |       /      \----< 0
       |      /--------\---< 0
       |       ||||||||
 +-----------+ ||||||||
 |    RST  Q0|-+|||||||
 |         Q1|--+||||||
 |MC14011  Q2|---+|||||
 |         Q3|----+||||
 |         Q4|-----+|||
 |         Q5|------+||
 |         Q6|-------+|
 |         Q7|--------+
 +-----^-----+ ||||||||
       |       |||||||\------------------------------------ ...
       |       ||||||\------------------------------------- ...
       |       |||||\-------------------------------------- ...
     SYNC      ||||\-------------------------------\
               |||\-----------------------\        |
               ||\---------------\        |        |
               |\-------\        |        |        |
             |'|      |'|      |'|      |'|      |'|
           /-|  >-\ /-|  >-\ /-|  >-\ /-|  >-\ /-|  >-\ /-- ...
           | |.'  | | |.'  | | |.'  | | |.'  | | |.'  | |
           |      | |      | |      | |      | |      | |
  /---------------+--------+--------+--------+--------+---> A
  |        |        |        |        |        |        |
  |      /--------+--------+--------+--------+--------+---- +5V
  |      | |      | |      | |      | |      | |      | |
  <      < |      < |      < |      < |      < |      < |
  >      > |      > |      > |      > |      > |      > |
  <      < |      < |      < |      < |      < |      < |
  |      | |      | |      | |      | |      | |      | |
  |   S0 +-/   S1 +-/   S2 +-/   S3 +-/   S4 +-/   S5 +-/   ...
  |      |        |        |        |        |        |
  |      0        0        0        0        0        0
  |       /        /       |        |        |        |
  |      0        0        0        0        0        0
  |      |        |        |        |        |        |
 -+------+--------+--------+--------+--------+--------+---- GND
Switch S0 is open, so the line going up to the buffer input is connected to 5V, so it's a 1. S2 is closed, so the buffer input is connected straight to ground, which is a logic 0. +5V is also connected to ground through the resistor, which is typically 10k. Therefore each switch draws about 0.5 mA when closed, which is negligible. The 100 entering the multiplexer at the top, which selects Q4, should be set similarly.

Now, as the Q lines go high, the buffers get activated one at a time and pass their S values. E.g., on the first cycle after reset, Q0 goes high, which activates the leftmost buffer. Then, A takes on the value of S0, which is logic 1 because the switch is open. On the second clock cycle, Q0 goes low and Q1 goes high, causing a similar chain of events involving S1. On the third clock pulse, S2 gets used. Since S2 is closed, A becomes 0 on that pulse. Etc., etc. The resistor on the far left makes sure that A is always 0 if no buffers are active.
black mariah wrote:Using the circuit you posted, you tell the MC14022B to output the sequence for the number 2, which is 11000. I do not know how to actually implement this. All I know is that's how it works. Like I've said before, my knowledge of digital logic is minimal at best.
I don't think it works like that. Each output on the 14022 will output a sequence with a single 1 in it. Q0=100, Q1=010, Q2=001, if you connect Q2 to Reset.
ED-057 wrote:I'm thinking you could take the circuit from the Japanese page and add a flip-flop to the output. Then wire up a couple more gates so that A is driven high by (one of the counter outputs AND the flip-flop output) or (another of the counter outputs AND NOT the flip-flop output).

Then you could set how many frames it would be on as well as how many frames it would be off for each cycle. (Hopefully this is understandable)
I -think- what you're talking about is to make the counter first reset after M cycles, then reset after N cycles, and keep alternating M high/N low. Is it? It sounds interesting. But I think that will actually give a 1, M-1 0s, another 1, and finally N-1 0s.

Datasheets:
14022 Octal counter
74125 Quad non-inverting buffer with separate enables, active low. 74126 has active high, which this idea needs, but I couldn't find a datasheet for that.
"Can they really get inside my head?"
"As long as you keep an open mind."
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

Post by ED-057 »

-think- what you're talking about is to make the counter first reset after M cycles, then reset after N cycles, and keep alternating M high/N low. Is it?
Yes, that is my plan.
I think that will actually give a 1, M-1 0s, another 1, and finally N-1 0s.
If I understand the existing circuit correctly (which I don't exactly, what is the carry used for?) that is what pin 6 of the 7400 will look like I guess. Everytime there is a 1 the flip-flop would toggle its output though so you'd end up with M 1's followed by N 0's...
User avatar
shiftace
Posts: 435
Joined: Tue Jan 25, 2005 10:18 pm
Location: yes

Post by shiftace »

Ah, I get it, I think it depends on what kind of flip-flop you use. R-S works with something like S = ((sync circuit's Q) & ~Q) and R = ((sync circuit's Q) & Q). There's probably an easy way to use a D flip-flop by putting logic on the clock input (although you're never supposed to gate the clock, as a general rule).

Anyway, a R-S flip-flop, 2 AND gates, and 2 mux/switch setups would make it programmable and doesn't use a lot of chips..

I don't understand the carry bit in the original autofire circuit, either.

And, it's occurred to me, in the buffer circuit I was trying to describe above, using Q0 might be a bad idea, because it is possible, very briefly, for 2 outputs to be active right when Reset is triggered. I wish I had a decent electronics setup, so I could actually test this thing...
"Can they really get inside my head?"
"As long as you keep an open mind."
Post Reply