Also, sorry for bumping the thread, but I'm wondering if it could be possible to make versions of these patches for the EZ-Flash 3-in-1 Expansion Pack? And if the rumble is non-functional in it's GBA mode, is there perhaps a trace to solder to that can enable it in GBA mode in addition to it continuing to work in DS mode?
Actually, ez3in1 does can support gba mode with rumble.
According to my reaserach, there are at least two types of rumble funtion addresses.
The first is origin rumble which works on GPIO. It seems EZODE and InsideGadgets rumble carts both can support this type.
Code:
TYPE1
#define GPIO_Data 0x080000C4
#define GPIO_Direction 0x080000C6
#define GPIO_Control 0x080000C8
RumblePrepare
{
*(GPIO_Control) = 0x1; //GPIO_Control.bit0 = 1
*(GPIO_Direction) = 0x8; //GPIO_Direction.bit3 = 1
}
RumbleStart
{
*(GPIO_Data) = 0x8; //GPIO_Data.bit3 = 1
}
RumbleEnd
{
*(GPIO_Data) = 0x0; //GPIO_Data.bit3 = 0
}
The second is address for EZ flash.
Code:
TYPE2
RumblePrepare
{
*(0x09FE0000) = 0xD200;
*(0x08000000) = 0x1500;
*(0x08020000) = 0xD200;
*(0x08040000) = 0x1500;
*(0x09E20000) = data; //data = 0xF1 in ezode rumble patch tutorial
*(0x09FC0000) = 0x1500;
}
RumbleStart
{
*(0x08001000) = 0x2;
}
RumbleEnd
{
*(0x08001000) = 0x0;
}
In tutorial EZflash supports for ezode, the value of "data" in function RumblePrepare is 0xF1.
However it cannot work on ez 3in1.
If you play the gba game with this ezode rumble patch in ez3in1, the game will frozen when rumble and make noise. (At least my ez3in1 512 frozen)
But it easy to solve this problem and make it to rumble on ez3in1.
——just low down the data value, such as 0x1, 0x7.
I've tested it and this can true works on ez3in1.
Add: it seems for ez3in1, it doesn't means the larger data value is, the stronger shake will be.
I haven't found too much material about the setting source code of ez3in1, so the following are just my own estimated settings by my testing——
0 - off, 1- weak, 3 - medium, 7 - strong. (add
8 - off)
some value like 0x4, 0x20 don't make shake stronger, but weaker. Hope someone who knows official value setting about ez3in1 can give the accurate values.
Also although the data value changes from 0xF1 to 0x7, this patched gba game still can rumble in ezode.
The difference is the shake will be weaker than 0xF1.
In addition, ez3in1 cannot support Type1 rumble function for gba game. ez3in1 can only support Tpye2.
As for InsideGadgets rumble carts, I don't have this cart, but
@djedditt patches used Type1 function, so it's true that IG supports Type1. Whether IG supports Type2 or not, I can't draw a conclusion.
So different flashcarts need to use different types of rumble funtion addresses to patch.
IG: type1.
EZ3in1: type2 (data value need to be low, such as 0x1, 0x7).
EZODE: type1, type2 (data value has a large range, the offical tutorial gives the value 0xF1, but use other value is ok too).
If you wants to let a patch works on all carts above, conbining two types of address may a good idea. If there is any way to let game recogrize which flashcarts the hardware is, we can make an "if else" to change the rumble type we need to work.
ADD:
During my testing, i found that in TYPE2 function for ez3in1, sometimes changing the vlaue in address 0x08001000 from 0x0 to 0x2 or from 0x2 to 0x0 worked well, but sometimes it didn't, it conituned shaking without stop.
In case someone meet the same problem as me, here is my solution when the latter happening.
Code:
TYPE2
RumbleStart
{
data = 0x7;
*(0x09E20000) = data;
}
RumbleEnd
{
data = 0x8;
*(0x09E20000) = data;
}
And here is a sample code conbining two types to support EZODE, EZ3in1 and IG rumble.
Code:
void RumbleSwitch( bool IfIsRumble )
{
if( *GBPflag == FLASE )
//if you don't care flashcarts rumbling when being pluged in gbp,
//or this game doesn't have gbp rumble,
//you can delete this judgment.
{
//TYPE1
*0x080000C8 = 1;
*0x080000C6 = 8;
*0x080000C4 = IfIsRumble * 8; //GPIO rumble ON(8) / OFF(0) (for ezode,IG etc.)
//TYPE2
*0x09FE0000 = 0xD200;
*0x08000000 = 0x1500;
*0x08020000 = 0xD200;
*0x08040000 = 0x1500;
if( IfIsRumble == TRUE )
int8 data = 0x7; //ez3in1 rumble ON (data = 7)
else
int8 data = 0x8; //ez3in1 rumble OFF (data = 8)
*0x09E20000 = data;
*0x09FC0000 = 0x1500;
*0x08001000 = IfIsRumble * 2; //ezode rumble ON(2) / OFF(0)
}
}