PPPPUURRRRUU PURU!

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
User avatar
SinisterTengu
DC Developer
DC Developer
Posts: 382
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Oct 17, 2001 7:44 pm
Location: Arlington, WA
Has thanked: 0
Been thanked: 0

Post by SinisterTengu »

So what I think we need to do now is come up with a purupuru_param_t to be defined in purupuru.h that lets a coder do something like

Code: Select all

purupuru_param_t param;

param.time = 2;
param.power = 4;
param.frequency = 20;

purupuru_rumble(dev, param);
and then purupuru_rumble will take that param and put the info into a uint32 and send it to the purupuru.

and then maybe we can make a purupuru_stop(dev) function too that just sends 0x00000000 to whatever device.

What do you think?
Image
Image
User avatar
APE
Newsposter
Newsposter
Posts: 2802
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by APE »

Too much use of altavista.
Image
A few fries short of a happy meal.
Kamjin
DC Developer
DC Developer
Posts: 216
Joined: Wed Dec 17, 2003 5:27 am
Has thanked: 0
Been thanked: 0

Post by Kamjin »

Sorry for the pause was.. out of town..
Driver you made works quite well...

For all intents.. the format of the _t should be that way..
BUt my only concern is that we're not 100% on the registers
yet.. If everyone was using the interact/sega units.
we'd be fine.. I'd suggest having the method.
as listed below
purupuru_rumble(dev, param);
purupuru_stop(dev)

and an interm as
purupuru_effect(dev, effect);
and list off the params that are universal
as define's.. and give a warning about.. making
sure of compatibility.. until more feedback happens
over time..

Well thanks to SinisterTengu.. anyone can now code
a rumble effect in KOS..
Now I expect the teris. and pong to show.. errr..
and Ian's XXX Puru--Baby--Puru!
dciris
DCEmu Junior
DCEmu Junior
Posts: 42
Joined: Thu Feb 06, 2003 3:51 pm
Has thanked: 0
Been thanked: 0

Post by dciris »

First of Sinister Tengu the purupuru driver is awesome :D ...I was wondering if there is any way to complie the code under kos 1.1.8?
User avatar
SinisterTengu
DC Developer
DC Developer
Posts: 382
Joined: Wed Oct 17, 2001 7:44 pm
Location: Arlington, WA
Has thanked: 0
Been thanked: 0

Post by SinisterTengu »

I've never used 1.1.8, dciris. I'm at school right now, but I'll download it and check it out when I get home. I'm sure there is a way to get it to work, I just don't know how different 1.1.8 handles maple stuff.
Image
Image
User avatar
SinisterTengu
DC Developer
DC Developer
Posts: 382
Joined: Wed Oct 17, 2001 7:44 pm
Location: Arlington, WA
Has thanked: 0
Been thanked: 0

Post by SinisterTengu »

Image

Download (source and unscrambled binary)

Ok, so I made a new demo that lets you hex edit an integer and send to your rumble pack. This is useful for making up your own rumble effects for now, until we get a purupuru_param_t thing sorted out. And feel free to post your discoveries.

A note about the effect shown in the picture above, I noticed when the lower C nibble is set to 8, the effect lasts much longer than when it is set to 0, and any other value would cause no effect to occur at all. After testing, I found that when lower C is set to 8, the effect lasts longer the lower the power in upper C is set to. When upper C is set to 7, setting lower C to 8 does not seem to change the duration at all. But when upper C is set to 1, and upper C is set to 8, the effect lasts a great while longer than when upper C is set to 0.
Image
Image
User avatar
APE
Newsposter
Newsposter
Posts: 2802
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by APE »

And now a good cheap replacement for those 3 girls out there too poor to afford vibrators.
Image
A few fries short of a happy meal.
ragnarok2040
DC Developer
DC Developer
Posts: 462
Joined: Wed Oct 17, 2001 7:44 pm
Has thanked: 0
Been thanked: 0

Post by ragnarok2040 »

I was wondering for what exactly puru-puru stands? I think it's purr-purr translated to katakana, and if it was, maybe they did have girls in mind for that device, cuz Japanese girls do like cute stuff, from what I understand.

/me clears throat

^_^
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

great demo.. And work on it.
Dreamcast forever!!!
Viktor
DC Developer
DC Developer
Posts: 30
Joined: Sun Nov 04, 2001 4:47 am
Location: Stockholm, Sweden
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Viktor »

Got my vibration pack today (euro version made by sega) the demo work but when I tested 0x42153810 the stop button did not work. When I press stop I get a quick screen "Please attach a purupuru to slot A-2!" and then back to the main screen still with rumble.

/Viktor
User avatar
SinisterTengu
DC Developer
DC Developer
Posts: 382
Joined: Wed Oct 17, 2001 7:44 pm
Location: Arlington, WA
Has thanked: 0
Been thanked: 0

Post by SinisterTengu »

Hmm, that's weird...pressing B sends 0x00000000 to your rumble pack which should make it stop right away..Has anybody else had this problem? And what brand is your rumble pack? Does it do it with all vibrations, or only that one? Maybe its not a good idea to use more complicated rumbles like that since not all rumble packs can take them..
Image
Image
Viktor
DC Developer
DC Developer
Posts: 30
Joined: Sun Nov 04, 2001 4:47 am
Location: Stockholm, Sweden
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Viktor »

I have had time to test some more now and none of the rumble codes I have tried have I been able to stop before thay stop automaticly. When you press Stop you can here the rumble pack stop for a split second and the it restarts from where it was interrupted. But as I say, it stops when the rumble is finished, you just cant stop it before that.

/Viktor
Kamjin
DC Developer
DC Developer
Posts: 216
Joined: Wed Dec 17, 2003 5:27 am
Has thanked: 0
Been thanked: 0

Post by Kamjin »

Sinister, that's a nice Nice tool!

Viktor, I tried the North American version.. and it stops with 0000000..
try feeding it the same value as the effect with just the upper byte set to 0x00
and see if that makes it stop.. or also with just the last byte set to 0x00.
Viktor
DC Developer
DC Developer
Posts: 30
Joined: Sun Nov 04, 2001 4:47 am
Location: Stockholm, Sweden
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Viktor »

Ok, I have tried to first send a rumble function and then send the same one but starting with a 0.
Start: 0x31071011
Stop: 0x01071011
No effect

Start: 0x3339f010
Stop: 0x0339f010
Effect!

Start: 0x2617a010
Stop: 0x0617a010
Effect!

Start: 0x42153810
Stop: 0x02153810
Effect
The effect that happens is a quick fade out of the rumble.
Viktor, I tried the North American version.. and it stops with 0000000..
And I cant think there is any difference between the two versions!

/Viktor
Kamjin
DC Developer
DC Developer
Posts: 216
Joined: Wed Dec 17, 2003 5:27 am
Has thanked: 0
Been thanked: 0

Post by Kamjin »

viktor,

try 0x3339f010
and to stop it try
0x0039f010 (old effect & 0x00FFFFFF)
or 0x00000010 (old effect & 0x000000FF)
or 0x0039f000 (old effect & 0x00FFFF00)




I'm going to try another sega rumble from a
friend.. I looked over my notes, and I did
write down that one rumble wouldn't take
another instruction, and would continue the
old effect if it thought it was invalid.. this might
be the same case..

I'd agree that the rumble I have here should be identical..
maybe there was some sort of code/hdl revision in the rumble..
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

Dreamcast control port was a revision. some models.
Dreamcast forever!!!
Viktor
DC Developer
DC Developer
Posts: 30
Joined: Sun Nov 04, 2001 4:47 am
Location: Stockholm, Sweden
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Viktor »

A happy test report :)
Stop: 0x0039f010 - No effect
Stop: 0x00000010 - RUMBLE STOPS!!!! :)
Stop: 0x0039f000 - Stops for split second and then restarts where it was interrupted, same as 0x00.
I tried this code,

Code: Select all

unsigned long effects[7]={0x00072010,0x011a7010,0x31071011,0x3339f010,0x2617a010,0x05281011,0x42153810};
...
if((state->buttons & CONT_A) && (rel_buttons & CONT_A)) {
	purupuru_rumble(purudev,effects[index]);
	printf("RUMBLE EFFECT!\n");
}
if((state->buttons & CONT_B) && (rel_buttons & CONT_B)) {
	purupuru_rumble(purudev,effects[index] & 0x000000FF);
	printf("RUMBLE STOPPED!\n");
}
and it worked as expected, when I press A it starts and when I press B it stops :)

/Viktor
Viktor
DC Developer
DC Developer
Posts: 30
Joined: Sun Nov 04, 2001 4:47 am
Location: Stockholm, Sweden
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Viktor »

Ian Micheal wrote:Dreamcast control port was a revision. some models.
I got the Dreamcast unit in late 2000 and it was a used unit so its proberly a early euro unit. The control is as old as the unit and the second control is a US one I got in early 2003.

/Viktor
Kamjin
DC Developer
DC Developer
Posts: 216
Joined: Wed Dec 17, 2003 5:27 am
Has thanked: 0
Been thanked: 0

Post by Kamjin »

I tested 0x00000010 as a stop on all the rumbles I have here,
it works fine.. I didn't check the interact rumble.. can't find it??!
But i think SinisterTengu has one.. he'll have to check it's
okay.. I guess unless someone finds different we'll assume
stop to 0x10 to be the new stop..
User avatar
SinisterTengu
DC Developer
DC Developer
Posts: 382
Joined: Wed Oct 17, 2001 7:44 pm
Location: Arlington, WA
Has thanked: 0
Been thanked: 0

Post by SinisterTengu »

no, mine is one of those Performance rumble/memory cards. I'm going to try to get a few more packs to test out. I'm not sure which local stores around here still have Dreamcast stuff. I'd really like to find an official sega version. Hopefully by the weekend anyways, I'm going to be a little busy with school through Thursday. And I guess that 0x10 stopping thing does make sense since its motor 1 that we want to stop. It works fine with my rumble pack.
Image
Image
Post Reply