PDA

View Full Version : cemu 2.10 fix Jan 11 2009


agarnet
01-12-2009, 04:42 AM
Thanks to noone:

For cemu 2.10, in nagra2.cc, find code for 0x3a and replace with this:



case 0x3a: //map21, a*a montg
if (MAPiCycles < 469)
{
BN_mask_bits(B,64);
wordsize=1;
}
else if (MAPiCycles == 804)
{
MakeJ();
BN_rshift(B,B,64);
BN_lshift(B,B,64);

cBN tmp1,tmp2,tmp3;

BN_rshift(tmp1,D,64);
BN_mask_bits(tmp1,64);
BN_lshift(tmp1,tmp1,64);


BN_copy(tmp2,D);
BN_mask_bits(tmp2,64);
BN_rshift(tmp2,tmp2,16);

BN_copy(tmp3,D);
BN_mask_bits(tmp3,16);
BN_lshift(tmp3,tmp3,48);

BN_copy(D,tmp1);
BN_add(D,D,tmp2);
BN_add(D,D,tmp3);

}

//New code starts here

else if (MAPiCycles == 2496)
{
MakeJ();
BN_zero(R);
BN_set_bit(R,136); //27:26
BN_mod(B,R,D,ctx);
for (int i=0; i<4; i++)
{
MonMul(B,B,B);
}
MonMul(B,A,B);
}

//end of new code

else
{
MakeJ();
BN_zero(R);
BN_set_bit(R,136); //27:26
BN_mod(B,R,D,ctx);
if (!MAPi || MAPiCycles > 1408) MonMul(B,A,A);
}
break;

noone
01-12-2009, 04:46 AM
this is for 2.10 not the module. you can get the module from the other thread :)

JT
01-12-2009, 05:01 AM
Code wrap is a useful tool with posts like this too. ;)