PDA

View Full Version : Dreamcast Rumble Pack Example



Greenymeany
September 10th, 2010, 22:37
I am trying to create a simple program, at the moment all I want it to do is play activate the rumble pack on all possible controllers, and set it to the maximum settings.

Eventually, I'm going to add the option to increase and decrease the amount of vibration, and different modes.

I can't find any examples on how to do this.


Thank you.

BlueCrab
September 11th, 2010, 01:31
I am trying to create a simple program, at the moment all I want it to do is play activate the rumble pack on all possible controllers, and set it to the maximum settings.That's a REALLY bad idea, especially if you're using any 3rd party rumble packs. The rumble uses a lot more power than most things, and the 3rd party ones are notorious for using even more. You're more likely to blow the fuse on the controller I/O board inside the console if you do that.

That said, the header file (http://cadcdev.svn.sourceforge.net/viewvc/cadcdev/kos/kernel/arch/dreamcast/include/dc/maple/purupuru.h?revision=669&view=markup) in KOS for the jump pack is fairly well documented, and explains how its really an inexact science to use them.

Greenymeany
September 11th, 2010, 03:45
That's a REALLY bad idea, especially if you're using any 3rd party rumble packs. The rumble uses a lot more power than most things, and the 3rd party ones are notorious for using even more. You're more likely to blow the fuse on the controller I/O board inside the console if you do that.

That said, the header file (http://cadcdev.svn.sourceforge.net/viewvc/cadcdev/kos/kernel/arch/dreamcast/include/dc/maple/purupuru.h?revision=669&view=markup) in KOS for the jump pack is fairly well documented, and explains how its really an inexact science to use them.

According to the header file, the maximum setting is 8.

What is a safe level.

Also, I am confused as to what I should actually be calling.

Do I just call

purupuru_rumble_raw(maple_device_t *dev, uint32 effect);

And replace maple_device_t *dev with the controller

And uint32 effect, with the desired effect?

Thank you.

BlueCrab
September 11th, 2010, 04:25
According to the header file, the maximum setting is 8.

What is a safe level.

Also, I am confused as to what I should actually be calling.

Do I just call

purupuru_rumble_raw(maple_device_t *dev, uint32 effect);

And replace maple_device_t *dev with the controller

And uint32 effect, with the desired effect?

Thank you.
its easier to use purupuru_rumble() than to use purupuru_rumble_raw(). If you use the rumble function, you set up a purupuru_effect_t and pass that as the second parameter. In the end the rumble function ends up calling rumble_raw internally, after doing a little bit with the effect structure.

No matter which function you use, the maple_device_t should be something returned by one of the maple_enum functions. This device must be of type MAPLE_FUNC_PURUPURU (i.e, not a controller device). For instance, to grab the first jump pack connected, you'd use:

maple_enum_type(0, MAPLE_FUNC_PURUPURU);

As for what is a safe level, in theory anything should be safe, but its really hard to answer that question. The 3rd party jump packs act completely different in many situations than official ones, and as I said, they can use a lot of power. You'll probably be OK as long as you aren't sending really long strings effects to many jump packs at the same time. Its all very guess-and-test, unfortunately.

You may want to refer to these two threads at dcemulation.org for more information about everything:
http://dcemulation.org/phpBB/viewtopic.php?f=29&t=92084 and http://dcemulation.org/phpBB/viewtopic.php?f=29&t=48462

The first of those two deals directly with the purupuru_rumble() function, whereas the other one has information if you would like to use the purupuru_rumble_raw() function (the second thread actually predates the KOS driver for the purupuru by a bit, and is what the driver in KOS is actually based on).

Hope that helps a bit.