PDA

View Full Version : Latest Cemu module1 dish and bell


JT
06-11-2008, 10:18 PM
Latest module1 for cemu. Thanks to fireball and others for their work.
{ // module 1 for b*v and d*sh 20080502 v3
BIGNUM *A=BN_new(); BIGNUM *B=BN_new(); BIGNUM *C=BN_new(); BIGNUM *D=BN_new();
BIGNUM *J=BN_new(); BIGNUM *Z=BN_new(); BN_CTX *ctx=BN_CTX_new();
unsigned char *_a=hw,*_b=&hw[0x10],*_c=&hw[0x20],*_d=&hw[0x30],*_j=&hw[0x40],*_z=hw;
unsigned int m=0x27+0x72+(A00[4]&0x3F)-0x79;
A00[0]|=A00[9];
memset(hw,0,sizeof(hw));
memcpy(hw,A00,0x05);
ExpandInput(hw);
RotateBytes(_a,0x10); BN_bin2bn(_a,0x10,A); RotateBytes(_a,0x10);
RotateBytes(_b,0x10); BN_bin2bn(_b,0x10,B);
RotateBytes(_c,0x10); BN_bin2bn(_c,0x10,C);
RotateBytes(_d,0x10); BN_bin2bn(_d,0x10,D);
RotateBytes(_j,0x08); BN_bin2bn(_j,0x08,J);
switch (m) {
case 0x39: //39,D0,04,
case 0x21:
{
BIGNUM *v=BN_new();
BN_zero(v);
BN_sub(J,v,D);
BN_set_bit(J,0);
BN_set_bit(v,64);
BN_mod_inverse(J,J,v,ctx);
BN_mask_bits(J,64);
BN_mod(D,D,v,ctx);
BN_mul(C,J,D,ctx);
BN_rshift(C,C,64);
BN_mask_bits(C,64);
BN_copy(Z,C);
memset(_z,0,8);
}
break;
case 0x38: //38,46,04,280
{
BIGNUM *s = BN_new();
BIGNUM *x = BN_new();
int Boctets=(BN_num_bytes(B)+7)>>3;
BN_zero(s);
for(int i=0; i<Boctets; i++) {
BN_rshift(x,B,i<<6);
BN_mask_bits(x,64);
BN_mul(x,x,B,ctx);
BN_add(s,s,x);
BN_copy(x,s);
BN_mask_bits(x,64);
BN_mul(x,x,J,ctx);
BN_mask_bits(x,64);
BN_mul(x,x,D,ctx);
BN_add(s,s,x);
BN_rshift(s,s,64);
BN_copy(Z,s);
if(BN_cmp(s,D)==1) { BN_sub(s,s,D); }
}
memset(_z,0,0x10);
}
break;
case 0x3A: //3A,4E,16,1408
{
BIGNUM *v=BN_new();
BN_zero(v);
BN_set_bit(v,136);
BN_mod(Z,v,D,ctx);
memset(_z,0,0x10);
}
break;
case 0x3E:
{
BN_mod_exp(B, A, B, D, ctx);
BN_copy(Z,A);
memset(_z,0,0x10);
}
break;
}
BN_bn2bin(Z,_z); RotateBytes(_z,BN_num_bytes(Z));
for (int i=11;i>-1;i--) hw[i]^=hw[i+4]; memset(&hw[4],0,0x7C);
}

sumpin4me
06-12-2008, 12:42 AM
so this is confirmed working for bell?

great job by the cemu coder team, especially Fireball for this update!

JT
06-12-2008, 01:08 AM
Confirmed working, for about last 24, both providers.

hughnohoo
06-12-2008, 04:59 PM
Thanks !
Question tho:
for each of these new modules, while compiling, I get an error message that says module1.inc:77:2: warning : no newline at end of file

I assume this is the equivilent of forgetting to dot the i and cross the t as the exe runs just fine, but is there an addl keystroke(s) that will correct this for me ? Since no one else has mentioned it, guess its just on my pc.

JT
06-12-2008, 07:00 PM
It's the result of c/p'ing the module from the forum. When you c/p it, go to the bottom of the page and press enter to add a blank line or two before you save the new module in your source files. That will stop the error, and that's why the error doesn't effect anything.

ronar
06-12-2008, 07:20 PM
You need to add a blank line when creating module1 file.

Open the file with Notepad, go to the last line of the file, and hit enter to add a blank line to the end of the file. :)

Cemu working good here so far
Thanks

hughnohoo
06-12-2008, 08:49 PM
thanks , worked fine.

andyman
06-13-2008, 04:23 AM
bev stoped working , worked great for two days

sumpin4me
06-13-2008, 05:53 PM
looks like bell has changed the timer on the map39... so the map39 code will need an update.