Dirt-cheap Vaus paddle clone for MSX

Page 3/5
1 | 2 | | 4 | 5

By Danjovic

Champion (323)

Danjovic's picture

06-04-2020, 01:29

Some digispark boards need to have its higher fuse programmed so the RESET pin can work as an I/O pin. That procedure can be done using another arduino board. (link) or using (USBasp) (clones will do fine too).

Srandard Paddle mode is providing a positive pulse from 12.125us to 3058us just like the specification in Red Book (details).

The pdl(1) function return values in the range of o to 255 with just a bare deadzone at the end (full clockwise). Here is a demonstration (video) using a BASIC Program.

Worth to mention that the Digispark board spends a few seconds after powered up doing its bootloading process. After that it starts to execute the main paddle code. (video)

Here is a couple of pictures of the working prototype.

Now that all everything is working, the operating modes, the programming features and even the automatic detection, I can call it a day and conclude this project. Time to move on to other stuff.

I really hope you all can enjoy it, build your own to play Arkanoid and Galaga and even better, enhance the code to add more features.

Project Page (link)
Github Repository (link)

By Danjovic

Champion (323)

Danjovic's picture

07-04-2020, 23:25

Dolphin101546015 wrote:
Danjovic wrote:

Are you trying to troll me? You won't succeed.
I could have a technical argue about either solution but I won't waste my french with that matter.
The potentiometer provides instantaneous response, and that's all I have to say.

Be easier, talking about such things, I will not prove anything since you behave this way.
Do what you think is necessary, since you want to spend your time in vain, on such attempts.

Browsing another topic on this forum I came across some of your posts and suddenly I realized that you are not a native english speaker.
Knowing that I read again your last posts here and think I must have interpreted your words wrongly tooking them as a provocation.

Sorry about that!

Let's leave this behind us and start over, ok?

By Dolphin101546015

Champion (335)

Dolphin101546015's picture

08-04-2020, 15:08

Danjovic wrote:

Sorry about that!
Let's leave this behind us and start over, ok?

Np, and yes, english is not my native, better for me is only chinese Big smile

So what I told before:
All stationary game automats with arcanoid what I seen (mostly FC may be, idk), uses rotary encoders (device like potentiometer, but with infinity rotations, and return not resistance, but impulses).
And when I seen Pro gamers, who playing it forever, they rotate it so fast that he made buzzing sounds and pad movements was with tremendous speed!

If you interesting, I have my own simples but effective interrupt code for AVR, reading encoder.
But I guess, if you want made something simelar, you need create something like software inertial system.

PS: Btw, this rotary encoder was also in Penguin Wars automat, and horizontal shooter like a Nemesis (rly dont remember nothing more).

By gdx

Enlighted (6103)

gdx's picture

08-04-2020, 15:45

Thanks to share this nice project.
Can the joystick port supply enough current for the Arduino Nano?

By Danjovic

Champion (323)

Danjovic's picture

09-04-2020, 01:39

Arcade machines had to be designed to endure thousands of hours of hard work, hence the use of a potentiometer is out of question for games involving a rotary knob.

Rotary encoders suits very well for such application, and even the early models made with physical contacts have a service life longer that any potentiometer.

Besides their high reliability, ordinary rotary encoders have a low angular resolution (Counts per Revolution) which requires a lot of turn to provide large number of steps. That is the reason why they have a flywheel attached. The flywheel allows the shaft to turn several times very quickly, and the user only have provide the initial impulse and let inertia do the rest.

Of course high resolution encoders are available but yet today they are not cheap.

The potentiometer on the other hand is a simpler solution in the sense that it requires less components (electrical and mechanical) and that brings the benefit of low cost, being the solution used by Taito on its consumer grade controller, but it also have its flaws, mainly long term endurance and friction (though the pot used by taito is smoothier than regular ones)

In terms of man-machine interaction both solutions are equivalent, the difference in handling is a mere trade between mastering Inertia or Friction and a person can train itself to be effective in either.

Your code is welcome, of course. I've been wondering about how to overcome the low CPR of a cheap rotary encoder by using the rate of change innstead of simply counting the steps, and this is pretty much the solution used on PC mice.

By Danjovic

Champion (323)

Danjovic's picture

09-04-2020, 01:57

gdx wrote:

Thanks to share this nice project.
Can the joystick port supply enough current for the Arduino Nano?

You welcome!
I have measured the current of the circuit with Digispark (~20mA) and UNO (~40mA).
A nano board should sink around 40mA. It is fine for the Joystick port.

By Dolphin101546015

Champion (335)

Dolphin101546015's picture

09-04-2020, 05:44

#define _enB		2
#define _enR		4
#define _enL		8
register volatile uint8_t  _enc_state  asm("r6"),  _pB asm("r8"),  _storB  asm("r9");

ISR (PCINT0_vect) 	
	_pB = PINB & ( _enL | _enR | _enB );			
	_enc_state = ((_pB & _enB)!=0)?(((_pB&_enR)<<1)^(_storB&_enL))|(((_pB & _enL)>>1)^(_storB & _enR)):_enB;
	_storB = _pB;	

Interrupt return only direction flags, or button like:
0b0000LRB0, where:
L - Left
R - Right
B - Button

For pulses counter, needed second timer interrupt, for counting repeated states inside period.
AVR able do it very fast.
So you will:
When encoder pulse coming, you will start timer interrupt (or any another period counter),
And inside period check, if dirrection was changed, reset period counter to 0.
Else - increment counter, and this counter mean amount of repeated pulses inside period.
Ofc you might create another system.

PS: register keyword is deprecated from C'11.

By Danjovic

Champion (323)

Danjovic's picture

09-04-2020, 17:57

Thanks for sharing the code.

As the rotary encoder requires two pins the configurable device (standard/vaus) would only be possible with nano/Uno.

To avoid issues with compiler the register variables can be replaced by memory.

I don' t think that interrupt concurrence should be critical for this application (wr still have to serve the MSX requesting Clock pulses and SOC) but it is better todeclare the interrupts as __NAKED.

By K72itNET

Rookie (19)

K72itNET's picture

24-04-2020, 12:27

Thanks.... Very Great Job....

This is my first version of Arkanoid Reply Case....

By hamlet

Scribe (4105)

hamlet's picture

24-04-2020, 18:42

That looks damn good!

Page 3/5
1 | 2 | | 4 | 5