8146 lines
1.5 MiB
JavaScript
8146 lines
1.5 MiB
JavaScript
|
var _cartname=[`drip.p8`];
|
||
|
var _cdpos=0; var iii=0; var ciii=0;
|
||
|
var _cartdat=[
|
||
|
0,0,0,0,0,0,0,0,0,0,0,0,128,136,136,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,0,0,0,0,160,170,0,0,0,10,0,0,112,7,119,7,112,119,0,0,0,6,0,0,0,6,0,0,96,0,0,0,0,0,0,128,136,136,8,128,136,136,8,136,136,136,136,128,136,136,8,128,136,136,0,0,0,0,0,128,136,136,8,170,10,0,0,0,160,160,0,0,0,10,0,112,119,119,103,119,119,119,7,0,0,6,0,0,0,6,0,0,96,0,0,0,0,0,0,136,136,136,136,136,136,136,136,136,248,255,143,136,136,136,136,136,136,136,8,128,136,136,8,136,31,255,129,160,0,0,0,0,160,160,0,0,0,10,0,119,102,102,102,118,103,119,119,0,96,0,0,0,0,6,0,0,96,0,0,0,0,0,0,136,248,255,143,136,248,255,143,136,31,255,129,136,248,255,143,248,255,143,8,136,136,136,136,136,255,255,143,0,0,0,0,0,144,154,0,0,0,10,0,103,119,103,102,103,102,102,119,0,96,0,0,0,0,6,0,0,96,0,0,
|
||
|
0,0,0,0,136,31,255,129,136,31,255,129,128,255,255,15,136,31,255,129,24,255,241,8,136,248,255,143,136,255,255,143,0,0,0,0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,96,0,0,0,96,0,0,0,0,6,0,0,0,0,0,128,255,255,15,128,255,255,15,0,51,51,0,128,255,255,15,240,255,255,8,136,255,255,143,128,51,51,8,0,0,0,0,0,144,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,96,0,0,0,96,0,0,0,0,6,0,0,0,0,0,0,51,51,0,0,51,51,0,112,0,0,7,112,51,51,0,0,51,51,7,128,31,255,1,0,51,51,0,0,0,0,0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,6,0,0,96,0,0,0,0,6,0,0,0,0,0,0,7,112,0,0,7,0,7,0,0,0,0,0,0,112,0,0,0,7,0,112,55,51,7,0,7,112,0,0,0,0,0,0,144,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,6,0,0,96,0,0,0,0,6,0,
|
||
|
85,85,85,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,136,0,148,153,153,73,148,153,153,73,148,153,144,73,48,0,11,11,102,86,102,86,48,0,11,11,0,0,0,0,0,0,0,0,7,0,0,0,85,85,85,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,136,136,8,25,17,17,145,25,17,20,145,25,65,144,145,0,179,51,0,118,86,118,86,0,179,51,0,0,119,0,0,112,7,112,0,112,0,0,112,85,0,0,85,0,0,0,0,0,0,0,0,0,0,0,0,160,170,170,10,0,0,0,0,128,135,136,8,25,17,17,145,25,17,25,145,148,4,64,145,32,136,136,2,118,7,118,7,32,136,136,2,0,119,7,7,112,119,0,0,0,0,0,0,85,0,0,85,0,7,0,7,64,153,153,4,0,0,0,0,154,137,136,168,17,17,17,17,128,136,136,8,25,17,17,145,73,73,64,145,0,0,0,68,128,137,136,8,112,0,112,0,135,137,136,120,112,119,119,7,112,7,0,0,0,0,0,0,
|
||
|
85,0,0,85,0,7,0,7,0,5,80,0,0,0,0,0,154,136,136,168,1,0,0,16,128,136,136,8,25,17,17,145,25,65,144,148,73,0,0,0,128,136,152,8,112,0,112,0,135,136,152,120,112,119,119,7,0,0,7,0,0,0,0,0,85,0,0,85,96,119,96,119,0,80,5,0,0,0,0,0,170,170,170,170,17,17,17,17,128,136,136,8,25,17,17,145,25,17,25,145,25,4,64,153,128,152,136,8,0,0,0,0,128,152,136,8,112,119,119,7,0,0,112,7,0,0,0,0,85,85,85,85,101,103,101,103,0,5,80,0,0,0,0,0,154,8,128,168,65,68,68,20,0,136,136,0,25,17,17,145,25,65,17,145,25,4,20,145,32,136,136,2,0,0,0,0,32,136,136,2,112,112,119,0,0,112,112,7,112,0,0,7,85,85,85,85,101,102,101,102,0,80,5,0,64,153,153,4,154,136,136,168,65,68,68,20,0,0,0,0,148,153,153,73,148,153,153,73,68,0,148,73,0,130,40,0,0,0,0,0,0,130,40,0,0,0,0,0,7,0,0,0,0,0,0,0,
|
||
|
117,119,119,87,117,119,119,119,119,119,119,119,119,119,119,87,119,204,204,204,204,204,204,204,204,204,204,119,117,119,119,87,85,85,85,85,85,85,85,85,85,85,85,85,85,0,0,0,112,119,119,7,0,0,0,0,0,0,0,0,0,0,0,0,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,199,204,204,204,204,204,204,204,204,124,119,119,119,119,119,85,85,85,85,85,85,85,5,80,85,85,85,102,7,0,0,119,119,119,119,0,112,119,119,0,0,0,0,0,0,0,0,119,199,119,119,119,119,204,204,124,119,119,199,204,204,119,119,119,199,204,204,204,204,204,204,204,204,124,119,119,119,119,119,85,85,85,85,85,85,85,0,0,85,85,85,118,119,7,0,119,119,119,119,0,119,102,7,0,0,0,0,0,0,0,0,119,204,204,119,119,199,204,204,204,124,199,204,204,204,124,119,119,119,204,204,204,204,204,204,204,204,119,119,119,199,124,119,85,85,85,85,85,85,5,0,0,80,85,85,102,6,0,0,119,119,51,119,112,118,119,0,0,0,0,0,0,0,0,0,
|
||
|
119,204,204,119,119,204,204,204,204,204,204,204,204,204,204,119,119,119,204,204,204,204,204,204,204,204,119,119,119,204,204,119,85,85,85,85,85,85,0,0,0,0,85,85,85,0,0,0,119,119,51,119,112,103,6,0,112,119,119,0,0,0,0,0,119,199,124,119,119,204,119,204,204,204,204,204,204,124,204,119,119,199,204,204,204,204,204,204,204,204,124,119,119,204,204,119,85,85,85,85,85,5,0,0,0,0,80,85,102,7,0,0,55,119,51,115,112,119,7,0,112,119,103,7,112,7,0,0,119,119,119,119,119,204,119,204,204,204,204,204,204,204,204,119,119,199,204,204,204,204,204,204,204,204,124,119,119,124,204,119,85,85,85,85,85,0,0,0,0,0,0,85,118,119,7,0,55,51,187,115,0,0,0,0,0,0,0,119,0,119,119,7,117,119,119,87,119,204,204,204,204,204,204,204,204,204,204,119,119,204,204,204,204,204,204,204,204,204,204,119,119,204,204,119,85,85,85,85,5,0,0,0,0,0,0,80,102,6,0,0,48,51,187,3,0,0,0,0,0,0,0,0,0,112,119,119,
|
||
|
119,204,204,119,119,204,204,204,204,204,204,204,204,204,204,119,117,119,119,119,119,119,119,119,119,119,119,87,119,199,204,119,85,85,85,85,5,0,0,0,0,0,0,80,0,0,96,102,48,51,51,3,0,0,0,0,0,0,0,0,0,0,0,0,119,199,204,119,119,204,204,204,204,204,204,204,204,204,204,119,119,119,119,119,119,119,119,119,119,119,119,119,119,199,124,119,5,85,85,85,85,0,0,0,0,0,0,85,0,112,119,103,48,59,51,3,0,0,0,0,0,238,224,14,0,0,0,0,119,199,204,119,119,204,199,204,204,204,204,204,124,199,204,119,119,119,204,124,119,119,119,119,199,204,119,119,119,199,124,119,85,85,0,85,85,5,0,0,0,0,80,85,0,0,112,102,48,51,51,3,0,0,0,0,0,238,238,14,0,0,0,3,119,204,124,119,119,204,204,204,204,204,204,204,124,199,204,119,119,199,204,204,199,119,119,204,204,204,124,119,119,204,124,119,85,85,0,85,85,85,0,0,0,0,85,85,0,0,0,85,48,51,59,3,0,0,0,0,0,224,232,0,0,0,0,11,
|
||
|
119,204,124,119,119,199,204,204,204,124,199,204,204,204,124,119,119,199,204,204,204,119,119,124,204,204,124,119,119,204,204,119,85,85,85,85,85,85,5,0,0,80,85,85,0,0,96,102,0,51,51,0,0,0,11,0,0,238,238,14,0,0,176,3,119,199,124,119,119,119,204,204,124,119,119,199,204,204,119,119,119,119,204,124,119,119,119,119,199,204,119,119,119,204,204,119,85,80,85,85,85,85,85,0,0,85,85,85,0,112,119,103,0,64,4,0,0,176,0,0,0,238,227,14,48,0,176,0,119,199,124,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,119,199,124,119,85,85,85,85,85,85,85,5,80,85,85,85,0,0,112,102,0,64,4,0,48,176,0,3,0,0,11,0,0,11,59,0,119,204,204,119,117,119,119,119,119,119,119,119,119,119,119,87,117,119,119,119,119,119,119,119,119,119,119,87,117,119,119,87,85,85,85,85,85,85,85,85,85,85,85,85,0,0,0,85,0,153,153,0,48,48,3,3,0,0,11,0,0,3,51,0,
|
||
|
117,119,87,117,119,117,119,87,112,119,119,119,119,119,119,119,119,119,119,7,112,119,119,7,0,0,0,0,46,46,226,0,204,204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,119,119,119,119,119,119,119,7,0,112,119,0,0,119,7,0,0,119,119,7,0,119,119,0,0,0,0,0,0,0,0,124,199,204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,119,204,119,119,204,119,119,7,204,119,199,204,124,119,204,204,124,119,112,7,124,119,112,0,0,0,0,0,0,0,0,124,199,124,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,119,199,204,204,204,204,124,119,7,124,119,204,204,119,199,204,204,119,199,112,7,119,199,112,0,0,0,0,0,0,0,0,204,204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
119,204,204,204,204,204,204,119,7,119,7,0,112,119,0,0,112,119,0,112,119,119,0,112,0,32,238,238,0,0,0,0,204,204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,0,0,0,0,0,0,0,0,0,0,0,0,0,117,204,119,204,204,124,204,87,119,119,0,0,119,7,0,0,119,7,0,112,119,7,0,112,0,226,238,238,238,238,2,0,204,199,204,204,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,6,0,0,0,0,0,0,0,0,0,0,0,0,117,199,119,204,204,204,124,87,7,0,0,0,0,0,0,0,0,192,0,112,7,0,192,112,0,238,238,238,238,238,46,0,204,204,124,204,0,0,0,0,0,0,0,0,0,0,0,0,208,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,119,199,204,204,204,204,124,119,7,0,0,0,0,0,0,0,0,0,0,112,7,0,0,112,0,46,34,34,238,238,238,0,204,204,204,204,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
119,199,204,204,204,204,124,119,7,0,0,0,0,0,0,0,0,0,0,112,7,0,0,112,0,238,238,238,238,238,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,192,0,96,0,0,0,0,0,0,0,0,0,0,117,199,204,204,204,204,124,119,7,0,0,192,0,0,0,0,0,0,0,112,7,204,0,112,0,46,226,34,34,46,226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,0,12,6,13,0,0,0,0,0,0,0,0,0,117,204,199,204,124,199,204,87,7,0,0,0,0,192,12,0,0,0,0,112,7,204,0,112,0,238,238,238,238,238,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,208,0,208,0,0,0,0,0,0,0,0,0,119,204,204,204,124,199,204,119,7,12,0,0,0,192,12,0,0,0,192,112,7,0,192,112,0,238,46,34,46,226,238,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
119,199,204,204,204,204,124,119,7,0,0,0,0,0,0,0,0,0,0,112,7,0,0,112,0,238,238,238,238,238,238,0,85,85,85,85,96,102,102,0,102,102,102,0,102,0,12,0,102,102,102,0,96,102,102,0,102,102,102,0,102,102,102,0,119,119,204,119,119,204,119,119,7,0,0,0,0,0,0,0,0,0,0,112,7,12,0,112,0,238,238,238,238,238,238,0,85,85,85,85,102,102,102,6,102,102,102,6,102,192,0,0,102,102,102,6,102,102,102,6,102,102,102,6,102,102,102,6,119,119,119,119,119,119,119,119,7,0,0,0,12,0,0,0,0,0,0,112,7,0,0,112,0,238,119,238,126,119,231,0,85,85,85,85,102,0,96,6,102,0,0,0,102,0,0,0,102,0,0,0,102,0,0,0,0,102,0,0,102,0,0,0,117,119,87,119,119,85,119,87,7,0,0,0,0,0,0,0,0,0,0,112,7,0,12,112,112,119,119,119,119,119,119,7,85,85,85,85,221,0,0,0,221,221,0,0,221,0,0,0,221,221,0,0,221,221,221,13,0,221,0,0,221,221,0,0,
|
||
|
0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,112,7,0,0,112,0,119,119,0,5,0,0,0,0,0,0,80,221,0,208,13,221,0,0,0,221,0,0,13,221,0,0,0,0,0,0,13,0,221,0,0,221,0,0,0,0,170,170,170,170,170,170,0,7,0,0,0,0,0,0,0,0,0,0,112,7,192,0,112,112,0,0,7,85,0,0,0,0,0,0,85,221,221,221,13,221,221,221,0,221,221,221,13,221,221,221,0,221,221,221,13,0,221,0,0,221,221,221,0,160,153,153,153,153,153,153,10,7,0,0,0,0,0,12,0,0,0,0,112,7,0,0,112,7,119,0,112,85,5,0,0,0,0,80,85,208,221,221,0,221,221,221,13,221,221,221,13,221,221,221,13,208,221,221,0,0,221,0,0,221,221,221,13,154,169,170,170,170,170,154,169,7,0,0,192,12,0,0,0,0,0,0,112,7,0,204,112,7,119,187,112,85,85,0,0,0,0,85,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
154,170,170,170,170,170,170,169,7,0,0,192,12,0,0,0,0,192,0,112,7,0,204,112,7,176,187,112,85,85,85,85,85,85,85,85,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,154,153,153,153,153,153,153,169,7,12,0,0,0,0,0,0,0,0,0,112,7,12,0,112,7,176,187,112,85,85,85,85,85,85,85,85,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,154,153,153,153,153,153,153,169,7,0,0,0,0,0,0,0,0,0,0,112,7,0,0,112,112,0,0,7,85,85,85,85,85,85,85,85,0,0,0,0,0,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,154,153,153,153,153,153,153,169,112,119,119,119,119,119,119,119,119,119,119,7,112,119,119,7,0,119,119,0,85,85,85,85,85,85,85,85,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,
|
||
|
170,170,170,170,170,170,170,170,112,119,119,119,119,119,119,119,119,119,119,7,112,119,119,7,0,180,187,0,0,180,0,0,0,4,176,187,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,74,73,73,26,161,148,148,164,7,0,119,7,0,0,119,7,0,0,119,119,7,0,119,119,0,180,187,187,0,180,11,0,0,180,187,187,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,192,0,0,0,74,73,74,26,161,164,148,164,7,124,119,204,204,124,119,204,204,124,119,112,7,124,119,112,64,2,176,187,64,178,187,187,64,178,187,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,12,0,0,74,73,68,170,170,68,148,164,7,119,199,204,204,119,199,204,204,119,199,112,7,119,199,112,64,0,0,0,64,0,187,11,64,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,192,0,0,
|
||
|
74,153,153,170,170,153,153,164,119,119,0,0,112,119,0,0,112,119,0,112,119,119,0,112,64,0,0,0,64,0,0,0,64,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,74,73,68,153,153,68,148,164,119,7,0,0,119,7,0,0,119,7,0,112,119,7,192,112,36,0,0,0,36,0,0,0,36,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,74,73,74,68,68,164,148,164,7,0,0,0,0,0,0,0,0,0,0,112,7,0,0,112,4,0,0,0,4,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,74,73,153,153,153,153,148,164,112,119,119,119,119,119,119,119,119,119,119,7,112,119,119,7,4,0,0,0,4,0,0,0,4,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
|
||
|
0,0,0,0,0,0,0,0,40,36,37,37,37,37,72,37,51,41,0,0,49,50,50,50,37,50,50,50,50,50,37,50,0,0,0,0,0,0,0,0,59,32,0,0,49,50,50,37,37,38,0,42,40,56,36,37,37,50,50,50,50,50,50,50,0,0,0,0,0,0,0,42,16,40,41,0,49,50,50,37,99,99,99,100,82,83,83,83,84,85,0,0,0,85,82,83,37,72,37,37,38,43,0,0,0,0,0,0,36,37,37,37,38,40,40,40,36,37,72,37,37,37,72,37,37,37,37,37,0,0,0,0,0,0,88,104,40,36,72,37,37,37,37,37,27,0,22,0,27,27,27,27,48,27,27,27,27,27,48,27,0,0,0,0,0,0,0,17,17,32,0,0,0,42,40,36,37,51,0,0,0,42,49,50,51,0,0,41,0,0,56,41,0,0,0,0,0,0,17,0,0,42,0,0,0,42,40,49,0,0,0,0,98,99,99,99,100,85,0,0,0,85,82,83,37,37,37,72,38,43,58,0,0,0,0,0,36,37,72,37,38,40,56,40,49,50,50,50,50,50,50,50,37,37,72,37,
|
||
|
0,0,0,0,0,0,42,16,40,49,50,37,37,72,37,37,0,0,0,0,0,0,0,0,55,0,0,0,0,0,55,0,0,0,0,0,0,0,59,52,53,54,0,20,0,0,16,49,38,43,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0,59,32,43,0,18,0,0,0,0,42,40,0,0,0,0,0,0,0,0,0,101,0,0,0,85,98,99,37,37,37,50,51,43,40,41,0,17,17,32,36,37,37,37,38,16,41,0,40,41,0,0,0,0,42,40,49,37,37,37,0,0,0,0,0,0,0,0,42,40,40,36,37,37,37,72,0,0,0,0,0,0,0,0,27,0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,59,52,53,54,57,0,0,27,38,114,115,115,115,115,115,115,115,115,115,116,17,0,0,22,0,0,0,17,0,0,27,0,59,32,43,0,0,0,22,40,0,0,0,0,0,0,0,0,0,0,0,0,0,101,0,0,37,37,51,40,40,40,40,16,58,33,34,34,37,37,37,37,38,40,0,0,42,0,17,17,17,0,0,40,56,36,37,37,
|
||
|
0,0,0,0,0,0,0,57,58,40,40,36,37,37,37,37,0,0,22,0,0,17,0,0,0,0,0,17,0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,32,16,40,0,17,37,34,34,34,34,34,34,34,34,34,34,34,35,43,0,0,0,0,59,32,43,0,0,0,0,27,0,0,0,0,0,42,0,0,0,0,0,0,0,0,57,0,0,0,0,0,0,0,72,38,40,40,40,56,40,40,40,49,50,50,37,72,37,37,38,41,0,0,0,17,66,67,68,0,0,42,40,36,37,72,0,0,0,0,0,0,0,42,40,56,40,36,72,37,37,37,0,0,0,0,59,32,43,57,22,0,59,32,43,0,22,0,39,57,58,0,0,0,0,0,0,0,0,27,42,40,57,33,37,72,37,37,37,37,37,50,50,50,50,50,38,43,0,0,0,0,0,27,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0,57,0,0,104,40,0,0,58,0,0,0,0,37,38,40,40,16,42,0,42,40,40,41,0,49,50,50,50,38,17,17,17,17,66,83,83,84,0,0,59,33,37,37,37,
|
||
|
0,0,0,0,0,0,0,0,40,40,40,49,50,50,50,50,40,0,0,58,0,27,58,40,57,0,0,27,0,0,0,0,55,40,56,57,17,0,0,0,0,0,0,17,58,40,40,49,50,50,50,50,37,72,38,40,41,0,42,16,55,43,0,22,0,0,0,0,0,0,59,32,43,0,0,22,0,0,0,0,0,0,58,88,40,40,104,40,40,40,40,40,57,0,0,0,37,38,56,40,41,0,0,0,0,42,0,0,0,0,0,0,37,34,34,34,35,98,99,99,100,0,0,59,36,37,37,37,0,0,0,17,17,17,17,58,40,40,16,27,27,27,27,27,40,57,40,40,57,0,40,40,0,0,0,0,0,0,0,0,27,0,42,40,39,17,0,0,0,0,59,39,40,40,56,27,34,34,34,35,49,50,51,22,0,0,104,41,0,0,0,0,0,1,0,0,0,0,0,27,0,0,0,0,0,0,0,0,104,57,40,40,40,40,16,41,0,0,42,16,40,58,103,104,37,38,40,40,57,0,0,0,0,0,0,0,0,0,0,0,37,37,72,37,37,35,40,56,41,0,0,59,36,72,37,37,
|
||
|
0,0,104,33,34,34,35,40,56,40,40,57,0,0,0,0,40,40,40,40,40,56,40,41,0,0,0,0,0,0,22,0,17,0,58,40,55,39,0,0,0,0,59,55,42,40,41,17,37,37,72,38,56,40,42,0,0,0,42,0,0,0,0,0,0,32,17,17,17,17,17,17,17,17,17,17,17,17,0,22,40,40,40,42,56,40,40,0,0,0,0,0,40,40,40,40,37,38,40,41,0,0,0,0,0,0,0,0,0,0,0,0,37,37,37,37,37,38,16,42,0,0,0,59,36,37,37,37,0,0,16,49,50,37,37,34,53,53,53,54,0,0,0,0,40,56,0,42,40,40,40,16,57,57,0,0,17,0,0,0,39,40,40,41,27,48,57,0,0,0,0,27,0,42,40,33,37,50,37,38,41,0,0,0,0,0,0,58,0,0,0,0,0,52,53,53,53,53,53,53,53,53,53,53,53,54,43,0,40,40,41,0,40,40,41,0,96,97,0,58,40,56,40,42,72,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,37,37,37,38,41,0,0,17,17,17,36,37,37,37,
|
||
|
0,0,42,40,40,49,50,38,27,27,27,27,0,0,0,0,41,0,0,0,0,42,40,40,40,40,57,59,39,43,0,0,55,40,16,0,17,48,40,58,0,0,0,17,0,40,40,49,38,1,49,51,22,0,0,0,0,0,0,40,57,0,0,0,0,32,40,56,40,40,40,32,40,40,40,40,40,39,43,0,56,40,0,0,42,40,61,0,112,113,63,40,40,41,0,0,37,38,0,0,0,0,0,0,57,0,0,0,0,0,0,0,37,37,37,37,72,38,0,0,59,33,34,35,49,37,72,37,0,0,0,40,56,41,59,48,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,40,40,40,40,59,48,43,0,0,27,42,40,56,39,48,40,16,57,0,0,39,58,40,41,27,38,23,0,0,0,0,0,0,57,0,0,56,40,0,0,0,0,27,42,40,40,16,40,27,42,40,56,42,40,55,43,0,40,40,57,0,0,40,33,34,35,33,34,35,40,0,0,58,50,51,0,0,0,0,0,0,40,41,0,0,0,0,0,0,50,50,50,50,50,51,0,0,59,36,37,37,35,49,37,37,
|
||
|
0,0,0,42,40,0,59,55,0,0,0,0,58,39,0,0,0,1,0,0,0,17,17,17,17,40,56,59,55,43,0,58,0,0,40,40,55,48,41,0,40,56,0,55,40,56,0,17,38,57,0,0,0,0,0,0,40,0,0,40,40,41,0,0,0,0,0,41,22,42,40,0,0,40,22,0,40,40,0,0,16,41,0,0,0,32,49,50,51,36,72,38,40,66,67,67,0,0,0,0,0,0,0,0,40,0,0,88,104,0,0,0,56,40,40,41,0,0,0,0,59,36,37,72,37,35,49,50,0,0,1,0,40,0,0,40,0,0,0,42,40,48,0,0,34,34,35,17,17,33,53,53,54,16,40,40,41,0,0,56,0,0,41,0,27,48,0,0,42,40,0,0,40,40,0,33,38,40,41,0,0,0,0,58,40,41,0,40,40,0,0,0,0,88,104,0,0,40,40,58,40,40,57,0,40,41,22,0,40,0,1,0,0,33,34,34,34,37,37,37,35,82,83,83,0,0,0,63,1,0,0,58,40,0,0,42,16,0,0,0,40,41,0,0,0,0,57,0,59,36,37,37,37,37,34,34,
|
||
|
64,0,33,34,35,43,0,56,57,18,0,104,56,48,57,0,37,72,37,34,34,38,12,0,42,40,40,40,0,0,58,40,1,0,0,0,58,55,8,0,0,40,57,0,40,41,0,49,38,40,0,0,0,0,0,40,56,0,58,40,16,0,0,0,0,42,40,40,40,41,42,40,40,56,40,40,40,0,0,0,67,67,67,67,68,36,37,72,37,37,37,37,38,82,83,83,0,0,0,33,54,0,0,56,40,57,0,0,40,0,28,0,40,1,61,62,0,58,40,0,59,36,37,37,37,72,37,37,33,35,36,37,38,43,104,40,40,39,40,40,16,48,40,0,37,37,37,37,72,38,0,0,0,40,40,41,0,0,40,40,35,0,0,0,56,40,57,0,0,42,40,16,40,0,0,27,38,56,57,0,0,0,0,40,40,0,40,40,40,57,0,0,0,0,0,56,40,0,0,0,42,40,16,40,0,0,0,0,83,83,83,83,84,36,37,37,37,37,37,72,38,82,83,83,0,0,0,48,66,68,0,40,40,40,0,0,40,57,0,0,34,34,34,35,16,40,56,57,59,36,37,37,37,37,37,37,
|
||
|
37,37,37,37,37,38,43,27,27,27,49,50,50,37,38,0,72,37,50,50,50,50,50,50,37,37,50,50,50,51,40,40,37,37,37,37,37,37,37,37,37,37,72,37,50,51,43,40,50,50,50,50,50,37,38,40,40,0,0,59,36,37,37,37,37,72,37,37,37,37,37,72,72,37,37,37,38,56,40,36,37,72,37,37,50,51,40,40,41,36,37,50,50,50,37,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,37,37,72,37,38,43,0,0,0,27,27,27,36,38,0,50,51,40,103,0,0,0,40,36,51,43,42,40,16,40,56,37,37,37,72,37,37,50,50,50,50,37,38,27,27,0,56,41,1,0,58,40,36,38,56,41,0,0,59,36,50,50,50,50,50,50,50,50,50,50,50,50,50,50,37,38,16,40,49,37,37,50,51,27,27,16,40,20,49,51,56,40,40,36,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
37,37,37,37,37,38,43,0,0,0,0,0,42,36,38,103,40,40,56,41,0,0,17,42,55,43,0,58,40,39,41,0,37,37,37,37,37,51,27,27,27,27,49,51,0,0,0,40,53,53,53,54,40,36,38,40,20,0,0,59,48,40,42,42,26,40,41,0,42,40,56,40,40,16,40,36,38,0,42,56,37,38,27,27,0,0,56,33,35,43,0,0,8,16,36,37,0,0,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,72,37,50,50,51,43,0,0,0,17,0,40,36,38,41,40,16,42,0,0,59,39,0,41,0,0,0,56,48,0,0,50,50,37,37,38,43,0,0,0,0,59,39,0,0,58,40,40,40,56,40,40,36,37,34,35,43,0,59,55,41,8,0,0,16,0,17,0,41,42,40,41,17,42,49,51,0,58,40,37,38,43,0,0,0,42,49,51,43,0,0,104,40,36,37,0,0,0,0,0,0,16,0,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
37,37,38,33,34,35,43,0,58,103,39,43,42,36,38,56,40,41,0,0,0,59,48,0,0,0,0,58,40,48,0,0,34,35,49,50,51,43,0,0,0,0,59,48,40,57,0,42,56,40,41,16,41,36,72,37,38,43,0,0,0,0,0,0,0,42,59,32,43,58,22,40,59,32,43,0,17,0,0,40,37,38,43,0,0,0,0,27,27,0,0,42,56,42,36,37,0,0,0,0,58,0,40,0,0,56,0,0,0,0,0,0,0,0,0,0,0,73,74,75,76,77,78,79,0,0,0,0,37,37,38,36,72,38,43,0,42,56,48,43,18,36,38,41,56,0,0,0,0,59,48,0,0,0,0,0,42,48,62,20,37,37,34,34,35,43,0,0,0,0,59,48,41,0,0,0,40,41,0,0,0,36,37,37,38,43,0,0,0,0,0,0,0,0,0,27,0,42,40,40,0,27,0,59,32,43,17,42,37,38,43,0,0,0,0,0,0,0,0,0,41,59,36,72,0,0,0,0,40,103,40,0,0,16,0,57,0,0,0,0,0,0,0,0,0,89,90,91,92,93,94,95,0,0,0,0,
|
||
|
50,50,51,49,50,38,43,18,0,40,48,43,23,49,51,0,40,57,88,104,57,59,48,17,17,17,17,17,17,36,34,34,37,37,72,37,38,43,0,0,17,0,59,48,43,0,0,0,40,17,17,17,17,36,37,72,38,43,0,0,0,0,0,0,0,0,0,0,0,0,17,16,103,88,17,0,27,59,32,22,72,38,17,17,17,17,0,0,0,22,0,0,0,59,49,37,0,0,0,0,40,56,40,118,0,40,103,40,0,0,0,0,0,0,0,0,0,105,106,107,108,109,110,111,0,0,0,0,40,0,0,0,42,48,17,39,0,42,48,43,0,16,16,57,40,40,56,40,52,53,50,53,53,53,53,53,53,37,37,72,37,37,37,37,38,43,0,59,39,0,59,48,43,0,0,0,40,52,53,53,53,50,50,37,38,43,0,0,17,0,0,0,0,0,0,0,0,59,32,40,40,56,39,43,22,0,27,0,37,37,35,33,34,35,43,0,0,0,0,0,0,0,27,36,0,0,0,0,42,40,40,33,35,40,56,41,0,0,0,0,0,0,0,0,0,121,122,123,124,125,126,127,0,0,0,0,
|
||
|
41,0,17,0,0,49,53,38,43,0,49,53,53,53,53,53,41,0,42,0,0,16,40,40,40,40,41,0,59,36,37,37,50,50,50,50,38,43,22,59,48,0,59,48,0,0,0,0,41,27,27,27,27,27,59,36,38,43,0,59,39,43,0,0,0,17,0,0,0,0,27,42,40,40,55,43,0,0,0,0,50,50,51,49,50,51,43,0,0,17,17,0,0,0,59,36,0,0,0,104,56,40,33,37,37,35,40,57,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,39,43,0,42,56,48,43,0,0,0,42,40,57,59,0,0,0,0,0,0,42,40,56,40,40,103,33,37,37,37,27,27,27,27,55,43,0,59,48,57,59,48,22,0,0,0,0,0,0,0,0,0,59,36,38,43,23,59,48,43,0,0,59,32,43,17,0,0,0,17,0,41,27,0,0,0,0,58,27,27,27,27,27,27,0,17,17,33,35,17,0,0,59,36,0,0,0,42,40,33,37,72,37,37,35,40,56,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
8,59,48,43,0,0,40,48,17,17,17,17,0,40,56,59,17,17,17,17,17,0,0,40,41,0,41,40,36,37,72,37,0,0,0,58,40,0,0,59,48,40,59,55,0,0,0,0,0,0,0,0,0,0,59,36,38,17,17,17,48,43,0,0,0,27,59,32,43,0,59,39,43,0,0,0,0,0,0,40,43,1,0,0,0,0,59,33,34,37,50,54,43,0,59,49,88,88,104,40,41,36,37,37,37,37,38,16,40,40,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,55,43,0,0,42,49,53,53,53,54,0,40,41,59,34,34,34,34,35,17,17,32,43,0,0,42,49,50,37,37,0,0,0,16,56,41,0,59,48,40,40,40,0,0,0,0,17,17,17,17,57,0,17,36,37,34,34,34,51,43,0,0,1,0,0,27,0,0,59,48,43,0,0,0,0,88,104,40,43,23,0,0,0,0,59,36,37,51,27,27,0,0,0,27,40,16,40,56,0,49,50,37,37,72,38,41,0,42,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
57,0,27,0,0,0,0,27,27,27,27,27,0,42,0,59,50,50,50,50,50,53,54,27,0,0,0,0,27,27,49,37,0,0,0,0,40,0,0,59,48,40,56,41,0,0,0,0,34,34,34,35,40,56,52,50,50,50,50,51,43,0,0,0,35,57,0,0,0,0,59,55,43,0,0,0,0,42,16,40,17,17,17,17,0,0,59,49,51,27,0,58,0,22,0,0,0,42,40,57,63,33,35,36,37,50,51,32,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,41,0,0,1,0,20,0,0,0,0,0,0,0,0,59,57,1,61,0,0,42,40,0,0,0,0,0,0,0,40,36,0,0,0,104,40,103,0,59,48,0,42,40,103,0,0,0,37,37,37,38,0,40,40,0,58,16,40,42,0,22,0,58,38,40,0,0,0,0,0,27,0,0,0,57,58,40,56,40,34,34,34,35,43,0,0,27,27,0,0,56,0,0,0,104,0,0,33,34,34,37,38,49,51,33,34,35,40,57,40,103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
16,103,88,58,33,34,35,17,17,17,17,17,0,18,0,59,34,34,35,57,0,16,40,57,0,0,0,0,8,58,16,49,1,0,58,56,40,41,0,59,55,0,0,56,41,0,0,0,37,72,37,38,0,42,40,40,40,56,41,0,0,0,0,40,38,56,57,18,0,0,0,0,0,0,58,40,40,40,40,16,37,72,37,38,43,22,0,0,57,0,0,40,58,0,58,40,1,0,49,37,37,72,37,34,34,37,37,37,35,16,56,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,56,40,40,36,37,37,34,34,34,34,35,0,23,0,59,37,37,38,40,58,40,56,40,0,0,0,0,0,56,40,40,35,0,16,40,40,0,0,0,56,0,0,40,16,0,0,0,37,37,37,38,23,23,40,56,40,0,0,0,0,0,58,40,38,40,16,39,57,0,0,0,0,42,40,40,56,40,40,40,37,37,72,38,43,0,0,58,56,0,58,40,16,40,56,40,33,34,35,36,37,37,37,37,37,37,72,37,37,34,34,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
35,49,37,37,72,37,37,50,50,50,50,50,51,0,0,36,37,38,36,37,37,38,49,50,50,50,37,38,40,40,40,36,37,37,37,37,37,37,50,51,40,56,40,40,49,37,37,37,50,50,50,50,51,0,0,0,49,50,50,50,50,50,50,50,50,51,0,0,0,36,50,50,50,51,49,50,50,50,37,37,37,37,37,72,37,37,37,37,37,37,37,38,40,40,36,37,37,72,37,37,37,38,40,40,40,40,36,37,72,37,37,37,38,40,40,40,40,49,50,50,50,37,72,37,37,37,37,37,37,35,49,50,50,50,51,41,0,0,40,41,0,0,0,36,37,38,49,50,50,51,40,40,0,40,36,38,42,16,40,36,37,72,37,37,37,38,0,42,40,40,41,40,16,36,72,37,40,40,40,41,0,0,0,0,40,40,41,0,0,0,0,0,40,16,0,0,0,55,40,41,0,0,0,0,42,40,49,72,37,37,37,37,37,72,37,37,50,50,50,51,40,40,36,37,37,37,72,37,50,51,56,40,42,40,49,50,37,37,72,37,38,40,56,40,40,40,42,42,40,49,50,50,50,50,37,37,
|
||
|
37,37,35,32,16,40,56,0,0,0,42,0,0,0,61,36,37,37,35,32,16,40,41,41,0,40,36,38,0,58,56,36,37,37,37,72,37,51,0,0,41,0,0,42,0,49,37,37,40,56,41,0,0,58,103,104,56,40,0,0,0,0,0,0,56,40,57,62,0,58,40,0,0,0,0,0,0,40,0,36,37,37,50,50,50,50,50,51,33,34,34,35,40,40,36,37,37,37,50,51,40,40,40,41,0,0,42,40,49,50,37,37,38,40,40,40,40,41,0,0,42,40,40,40,56,40,36,72,50,50,51,40,40,40,41,0,0,0,0,0,63,32,32,36,72,37,38,40,40,41,0,0,0,42,36,51,0,0,42,36,37,50,37,37,38,0,0,0,0,0,0,0,0,0,49,37,41,0,0,0,0,33,34,35,40,40,0,0,0,0,0,0,42,40,40,52,53,54,41,0,0,0,0,0,0,40,57,36,37,38,33,34,35,32,33,35,49,50,50,51,40,40,36,37,72,38,43,0,0,0,0,0,0,0,28,0,0,59,36,37,38,40,40,40,0,0,0,0,0,40,40,40,40,40,36,37,
|
||
|
35,64,40,56,40,41,58,40,57,0,0,0,52,53,34,37,37,72,38,41,0,0,0,0,0,0,48,0,0,0,0,36,51,0,49,37,51,61,63,0,0,0,0,0,0,0,0,49,0,0,28,58,58,49,37,38,32,40,57,0,0,0,0,0,0,16,40,40,40,41,0,0,0,0,17,17,58,40,40,49,50,51,36,37,38,16,49,51,32,40,40,40,40,56,36,37,37,38,43,0,0,0,0,0,0,0,0,0,0,59,36,37,38,42,40,40,103,0,22,0,42,40,40,56,40,40,36,37,38,58,40,40,40,16,40,41,0,0,0,0,0,0,49,37,37,50,51,0,0,0,0,17,0,0,55,0,0,0,62,36,0,0,0,55,33,34,35,0,0,0,0,0,0,0,0,0,57,88,104,40,40,40,36,38,40,41,0,0,0,0,0,0,42,40,40,41,0,0,0,0,0,0,33,35,40,56,40,41,40,40,49,50,51,40,40,41,0,42,0,42,40,40,36,37,37,51,43,12,0,0,0,17,17,0,0,0,12,59,49,72,38,17,40,16,0,0,0,0,104,40,40,40,40,40,36,37,
|
||
|
37,34,53,53,54,40,40,0,0,0,0,0,0,58,40,36,38,0,61,0,58,57,0,39,0,0,0,0,0,0,33,37,0,26,0,0,36,37,38,17,17,17,17,0,0,0,0,44,40,56,40,40,40,56,49,51,40,0,0,0,23,23,0,0,0,42,0,0,0,0,17,17,0,0,36,38,16,40,41,0,40,40,27,27,27,40,40,0,0,0,0,0,42,33,37,72,38,40,57,0,0,0,59,52,54,43,0,0,0,0,40,36,37,35,40,40,58,103,0,58,40,40,40,41,0,42,49,50,37,51,56,40,40,41,0,0,0,0,0,0,0,40,56,36,37,35,32,32,16,41,0,48,57,0,0,0,0,88,36,72,0,0,0,58,49,50,50,53,53,53,54,103,88,0,0,60,40,40,40,40,16,40,33,35,41,0,0,0,0,0,0,0,0,0,0,0,0,0,52,54,0,58,36,38,40,40,0,0,56,40,57,0,0,0,42,41,0,0,0,0,0,49,50,50,38,16,16,0,0,0,0,40,40,57,0,0,0,0,42,36,37,51,40,40,40,56,0,40,40,40,57,0,0,0,23,0,
|
||
|
38,0,0,42,40,0,0,0,0,58,40,58,40,40,40,36,37,37,34,35,40,57,0,55,40,88,57,0,104,40,49,50,0,0,0,40,40,40,40,40,32,32,40,40,40,57,33,34,40,41,0,42,40,40,36,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,56,40,40,49,37,35,0,0,0,40,40,40,41,0,0,0,0,0,22,58,103,104,40,40,0,51,56,40,11,0,0,0,16,56,40,0,0,11,0,0,49,51,40,40,40,40,40,104,40,40,40,40,0,0,0,23,0,51,0,0,0,40,103,88,0,0,40,16,40,40,52,34,37,37,37,72,38,40,40,103,32,40,40,40,56,40,40,33,34,0,0,58,40,56,40,16,41,0,0,42,40,56,40,36,37,42,0,0,0,40,56,36,38,0,0,0,23,23,0,0,0,0,0,0,0,0,0,39,40,40,42,40,49,51,57,0,0,40,41,0,0,0,0,0,0,0,0,42,40,40,40,41,0,42,40,57,0,0,0,0,42,40,41,0,0,0,0,0,0,40,40,40,56,40,40,40,40,40,40,41,0,0,0,0,0,
|
||
|
0,0,0,58,40,40,56,62,58,40,40,40,56,40,36,37,72,37,37,38,0,42,40,39,41,0,42,40,40,52,50,37,0,0,0,42,40,40,40,0,0,0,0,40,16,40,36,37,0,0,0,0,42,40,36,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,40,0,0,0,42,40,40,57,0,40,0,0,0,57,40,57,0,0,0,0,0,40,40,0,0,0,40,41,0,0,0,42,40,40,0,0,0,0,0,0,0,42,40,40,40,40,16,40,40,40,40,103,88,0,0,0,0,0,0,0,40,56,40,40,33,35,40,0,0,42,40,36,37,50,50,37,38,0,58,40,48,0,0,0,0,42,40,40,36,0,0,0,0,0,42,40,17,17,17,17,40,40,40,36,72,0,0,0,58,40,40,49,51,0,0,0,0,0,0,23,23,0,1,63,0,0,0,32,41,0,0,0,0,56,40,0,0,40,1,58,40,40,16,40,88,0,0,0,58,40,41,0,0,0,42,40,12,0,0,0,58,56,12,0,0,0,0,0,12,0,0,42,40,40,40,40,40,41,40,40,41,0,0,0,58,
|
||
|
0,1,58,33,35,40,42,49,51,41,0,17,17,17,36,37,0,40,49,38,58,56,41,48,0,0,0,0,0,0,42,49,0,0,0,0,0,0,40,52,34,34,54,41,42,0,36,37,62,1,58,56,40,41,42,0,0,0,0,0,0,0,0,0,53,53,53,54,0,0,32,0,0,0,0,61,42,40,103,20,34,34,35,40,40,40,40,40,57,0,88,40,56,40,61,0,0,58,41,0,0,0,0,40,40,0,0,0,0,0,0,0,0,0,42,40,40,42,41,0,0,88,16,0,18,0,42,40,34,34,34,37,38,41,0,33,35,17,17,33,34,34,37,37,0,42,56,55,40,41,0,48,17,17,17,0,0,0,58,40,0,1,63,0,0,0,42,40,36,38,41,0,0,0,36,37,34,34,34,35,41,0,0,0,0,0,0,0,23,23,0,0,42,40,32,57,0,58,32,0,0,58,0,52,53,53,53,53,37,37,37,34,34,34,35,40,40,40,40,16,40,40,33,34,11,16,0,0,0,0,11,40,16,0,0,0,11,0,0,0,44,0,0,40,56,0,0,0,0,42,40,57,23,0,0,40,
|
||
|
37,72,37,37,38,17,17,36,37,34,34,37,37,37,72,37,0,1,42,40,40,103,63,36,34,34,35,0,0,0,56,40,34,34,35,0,0,18,0,42,36,38,0,0,0,18,36,37,37,37,37,38,0,0,0,0,23,23,0,0,0,0,0,0,0,56,32,40,57,40,39,8,0,40,103,104,32,40,40,40,37,72,37,37,37,37,38,42,40,40,33,34,34,34,37,37,58,40,1,61,0,0,0,104,40,57,0,0,0,0,0,0,60,1,104,40,40,0,23,23,23,0,58,40,0,0,58,40,37,37,37,37,37,34,34,37,37,37,37,37,37,37,37,37,34,34,34,34,34,34,34,37,37,72,38,103,88,104,40,40,37,72,38,0,0,39,0,0,36,38,0,0,0,33,37,37,37,37,72,38,23,23,0,0,0,0,0,0,0,0,0,0,0,42,32,40,16,40,48,0,58,40,40,40,32,40,40,40,37,37,37,37,72,37,38,0,0,42,36,37,37,37,72,37,40,33,34,35,0,0,0,40,40,40,0,0,0,0,0,0,34,34,34,35,40,103,0,0,0,0,40,40,57,0,40,56,
|
||
|
37,50,51,0,0,0,36,50,50,50,50,50,50,50,37,37,37,37,38,40,40,40,40,36,37,50,50,50,50,37,72,37,37,50,50,50,50,50,50,50,37,38,40,40,40,36,72,37,37,37,37,51,0,0,0,0,0,0,0,0,0,0,0,82,37,37,50,50,50,50,51,49,50,50,50,50,51,40,41,0,38,40,41,40,103,0,0,0,0,0,40,40,49,50,50,50,37,37,37,50,51,40,40,0,49,37,37,72,37,37,37,72,37,37,72,38,40,56,40,49,50,50,50,50,50,50,37,72,38,40,40,0,0,0,48,64,42,40,40,40,40,40,36,37,37,72,38,40,56,40,40,49,51,56,40,41,0,49,50,37,38,40,0,0,22,58,40,40,49,51,40,40,56,36,37,37,72,37,38,0,0,0,0,0,0,0,0,0,0,0,0,82,37,38,0,0,22,0,0,0,0,42,16,40,40,56,57,0,38,40,26,56,32,57,61,0,0,0,0,42,56,40,40,40,37,37,38,40,40,40,41,0,59,36,37,50,50,50,50,50,50,50,50,51,40,40,40,40,40,40,16,40,40,32,49,37,
|
||
|
51,40,57,0,0,0,55,0,0,42,56,40,0,42,36,37,37,37,38,40,40,40,40,32,40,41,42,0,0,0,42,49,51,40,17,17,17,40,40,40,0,0,40,0,42,49,37,37,37,37,38,0,0,0,0,0,0,0,0,0,0,0,0,82,37,38,0,0,0,0,17,17,0,0,0,41,42,40,41,0,38,40,58,40,32,16,32,17,17,17,33,34,35,40,40,16,37,37,38,40,56,40,0,0,59,36,38,43,0,42,42,56,40,40,40,40,40,41,0,42,40,0,40,40,56,40,40,49,40,40,16,41,0,0,0,0,0,0,40,40,57,0,36,72,37,37,38,40,41,0,40,32,103,0,0,0,0,0,0,0,56,16,33,34,35,40,56,41,0,58,16,41,0,42,36,37,50,50,51,103,0,0,0,0,0,0,0,0,0,0,66,0,37,38,57,0,0,0,33,35,0,0,0,0,0,33,34,34,37,34,34,35,33,34,35,33,34,35,36,72,38,40,40,40,50,50,51,40,40,40,0,0,59,49,51,43,0,0,0,40,16,40,41,0,0,0,0,0,41,0,42,40,40,40,41,0,
|
||
|
40,40,40,0,22,0,0,0,22,42,40,40,40,0,36,37,37,37,38,39,0,0,42,32,41,0,0,0,0,0,0,0,40,52,37,37,51,41,42,0,0,0,42,0,17,17,36,37,34,35,40,40,0,0,44,70,71,44,0,0,0,66,83,83,37,38,40,0,0,58,36,38,0,0,22,0,0,36,37,37,37,37,72,38,49,50,51,49,50,51,36,37,38,32,40,56,34,34,35,40,41,40,103,0,0,40,41,0,0,0,0,0,40,56,0,17,17,0,0,18,0,0,0,40,41,42,22,0,40,56,40,0,0,0,0,0,0,0,58,40,41,0,36,37,72,37,38,55,0,0,0,41,0,0,0,0,0,0,0,58,41,59,36,38,40,57,0,0,0,0,0,59,33,34,37,37,37,38,56,40,103,0,60,86,87,60,66,67,67,83,99,99,50,51,40,57,0,40,36,38,17,17,17,17,17,36,37,37,37,72,37,38,32,27,27,27,27,27,36,37,38,40,40,40,37,37,38,0,0,42,40,20,58,41,0,0,0,0,0,0,40,41,59,33,35,0,0,23,0,0,17,40,103,0,0,0,
|
||
|
40,40,40,103,88,0,0,0,88,104,40,56,0,0,49,50,50,50,51,32,0,0,0,0,0,0,0,0,0,39,40,40,0,59,36,38,41,0,0,0,0,0,0,59,49,37,72,37,37,51,40,40,40,57,33,34,34,35,82,83,83,100,0,0,41,0,42,40,56,40,49,50,53,53,53,53,34,37,72,37,37,37,37,37,35,0,0,0,0,0,49,50,51,40,16,40,72,37,38,17,17,17,52,53,54,17,17,17,17,0,0,0,0,0,59,49,51,17,17,17,17,17,39,40,41,0,0,59,40,40,40,40,16,41,0,0,0,42,40,40,103,0,0,40,53,53,53,54,17,17,0,0,0,0,0,0,17,48,40,56,0,59,49,51,0,0,0,0,0,0,0,42,40,49,50,37,38,42,40,40,16,40,36,37,37,38,98,99,100,0,0,0,0,22,0,40,40,40,41,0,0,0,0,0,49,50,37,37,37,37,37,37,38,103,88,0,0,0,32,0,0,42,40,40,37,37,50,53,53,53,34,34,34,34,34,53,54,57,0,0,0,0,59,52,53,53,53,53,53,54,48,56,0,0,0,23,
|
||
|
40,41,0,0,42,0,0,0,0,0,56,42,41,0,58,40,40,40,40,52,54,32,0,0,0,0,0,0,32,48,40,40,0,0,42,41,0,0,17,17,0,0,0,0,40,40,40,49,38,0,41,0,42,40,36,72,37,37,35,0,0,0,0,0,57,0,58,40,41,0,0,0,0,0,0,0,0,40,49,50,37,37,72,37,38,56,41,0,0,0,23,0,0,88,104,40,50,51,16,40,41,59,36,72,37,37,38,40,40,40,0,0,0,0,59,32,27,27,27,27,27,27,48,40,0,0,0,23,40,58,0,0,0,0,0,0,0,0,40,0,0,0,40,40,40,56,16,41,42,0,0,0,0,0,0,0,42,55,16,40,17,17,17,17,17,17,33,54,0,0,0,0,42,40,56,11,38,0,0,0,0,33,37,37,37,37,38,0,28,0,0,0,40,40,40,16,0,0,0,0,0,17,0,0,42,56,40,41,37,37,37,37,38,40,0,0,0,0,23,0,0,42,33,34,40,40,41,8,0,59,36,37,37,72,38,40,40,41,18,0,0,0,0,27,0,0,0,0,0,0,48,41,0,0,0,59,
|
||
|
56,41,0,0,0,0,0,0,0,58,16,41,0,0,40,56,40,40,40,0,0,0,0,0,0,0,0,0,0,42,40,40,34,53,53,53,53,53,51,0,0,0,0,0,0,40,40,57,51,0,0,0,0,49,50,37,37,37,51,0,0,0,0,0,40,56,40,41,0,0,0,0,59,32,43,0,104,40,40,0,50,50,50,50,51,41,0,0,0,0,0,0,0,0,49,37,40,40,0,0,0,59,49,50,50,37,38,56,40,0,23,0,0,0,0,0,0,0,0,17,0,0,55,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,42,0,0,0,40,41,40,41,42,0,0,0,0,0,0,0,0,0,0,0,40,42,51,40,56,40,40,41,0,0,0,0,0,0,0,16,40,40,0,0,0,0,66,67,68,36,37,38,40,57,0,0,0,0,40,0,42,0,0,17,0,0,0,27,0,42,32,16,41,44,27,27,27,27,0,0,0,0,0,0,0,0,0,0,16,49,40,41,22,0,0,0,27,27,27,49,51,40,16,103,0,0,0,0,0,17,0,0,58,39,0,0,27,0,0,0,0,0,
|
||
|
0,0,1,0,0,0,17,17,17,0,0,0,0,0,42,58,42,0,0,0,0,0,0,0,0,0,0,0,0,42,40,0,40,40,41,0,42,0,0,0,0,0,0,0,0,40,40,40,0,0,0,0,82,83,84,36,72,38,40,40,0,0,0,0,41,0,0,0,59,32,43,57,0,0,0,0,41,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,40,40,0,0,0,0,0,0,0,0,27,27,42,40,41,0,0,1,0,0,39,57,0,56,48,0,0,0,0,0,0,0,0,17,17,32,17,17,17,33,34,35,0,0,0,18,18,0,42,0,1,0,0,0,0,0,0,0,0,0,0,0,0,41,0,41,0,0,0,0,0,0,0,0,0,42,103,104,40,41,0,0,63,1,0,82,83,84,36,37,38,40,16,103,58,57,0,1,63,0,0,0,42,56,41,0,17,0,0,0,0,0,33,1,0,0,0,0,0,0,0,58,103,0,0,0,0,42,56,40,103,88,104,0,0,1,0,0,0,0,104,40,0,0,0,33,35,0,55,40,41,40,48,0,0,0,0,0,0,0,0,
|
||
|
34,34,34,34,34,35,36,72,38,17,17,17,32,32,17,17,0,39,57,0,0,23,23,0,0,0,23,23,0,0,0,0,0,1,0,0,0,0,23,23,0,0,0,40,40,56,57,58,0,33,34,35,82,83,84,36,37,51,40,40,40,56,41,0,34,35,43,0,0,8,40,57,59,39,0,0,0,0,20,36,35,0,0,0,18,0,0,0,40,41,0,0,0,0,0,40,40,40,16,40,103,0,23,23,23,23,23,40,40,57,0,0,49,51,57,39,16,18,40,55,0,0,0,0,0,0,0,0,37,72,37,37,37,38,36,37,38,33,34,34,34,34,34,34,58,48,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,0,0,0,0,0,0,0,58,40,40,40,40,40,0,36,37,38,82,83,84,36,38,40,40,40,40,40,40,57,37,38,43,0,0,58,40,16,59,48,0,0,0,33,34,37,38,0,0,0,39,0,0,58,40,0,0,0,0,0,0,40,40,56,40,40,40,57,0,0,0,88,104,40,56,40,0,0,34,35,56,48,40,23,40,39,0,0,0,0,0,0,0,0,
|
||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,3,3,3,3,3,3,3,3,4,4,4,2,2,0,0,0,3,3,3,3,3,3,3,3,4,4,4,2,2,2,2,2,0,0,19,19,19,19,2,2,3,2,2,2,2,2,0,2,0,0,19,19,19,19,2,2,4,2,2,2,2,2,2,2,0,0,19,19,19,19,0,4,4,2,2,2,2,2,2,2,0,0,19,19,19,19,0,0,0,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
149,10,86,68,10,22,12,68,10,22,12,68,10,11,12,68,20,19,18,68,10,22,12,68,10,22,12,68,10,145,18,68,65,66,67,68,65,66,67,68,152,25,26,68,24,25,26,68,28,27,26,68,29,27,26,68,31,33,26,68,31,26,33,68,30,26,34,68,32,154,36,68,65,66,67,68,65,66,67,68,170,39,41,68,42,39,41,68,47,43,41,68,47,43,44,68,47,43,41,68,47,43,44,68,46,45,48,68,52,49,39,68,53,178,39,68,65,66,67,68,189,126,67,68,61,126,67,68,61,74,67,68,61,190,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,184,58,60,68,57,187,60,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,65,66,67,68,
|
||
|
246,14,35,15,239,14,29,15,234,14,23,15,231,14,19,15,227,14,17,15,222,14,14,15,218,12,12,13,214,10,8,9,210,6,5,5,153,1,153,1,153,1,153,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,191,1,0,2,0,0,17,14,19,14,26,14,36,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,13,14,16,14,22,14,34,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,6,5,8,5,9,5,11,5,34,9,42,11,188,11,187,11,187,11,185,11,182,11,178,11,173,11,168,11,164,9,161,9,157,9,154,9,150,7,145,7,142,7,139,5,135,5,133,3,131,3,144,1,
|
||
|
144,1,128,1,128,1,128,1,128,1,128,1,0,2,0,0,15,14,30,14,18,14,34,14,23,14,38,14,27,12,44,12,33,10,49,10,39,8,54,8,43,6,58,6,48,4,62,4,53,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,201,15,201,15,201,13,201,11,200,9,199,7,198,5,197,83,245,1,244,1,244,1,244,1,244,1,244,1,244,1,245,1,245,1,245,1,245,1,245,1,244,1,244,1,244,1,243,1,243,1,243,1,243,1,192,1,192,1,192,1,192,1,192,1,0,3,0,0,100,14,78,14,109,14,86,14,116,14,96,12,123,12,104,10,127,8,111,4,104,2,93,2,80,2,67,2,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,0,3,0,0,80,2,82,2,84,2,86,2,90,4,96,4,102,6,114,8,114,8,116,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,
|
||
|
64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,0,2,0,0,7,14,10,14,14,14,16,14,22,14,34,14,47,14,47,12,44,12,44,10,47,10,47,8,44,8,44,6,47,4,47,2,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,69,2,71,6,191,9,191,9,191,7,191,5,191,3,191,83,191,1,191,1,191,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,128,1,0,3,0,0,193,95,128,81,193,95,193,81,163,91,193,95,129,81,128,81,193,95,128,81,193,81,135,81,163,91,128,81,193,95,128,81,193,95,193,81,193,95,128,81,163,91,193,95,129,81,128,81,193,95,128,81,165,81,129,81,163,91,165,81,193,95,163,91,1,16,0,32,29,8,29,8,29,6,29,4,24,8,24,8,24,6,24,4,27,6,27,4,
|
||
|
34,8,34,104,31,86,31,6,22,8,22,8,29,8,29,8,29,32,19,28,24,6,24,6,24,32,31,28,36,10,34,4,22,8,19,4,29,8,27,36,24,8,24,8,0,32,0,0,7,14,7,12,7,10,17,0,7,14,7,12,3,26,15,14,10,14,10,12,10,10,10,0,10,14,10,12,5,10,5,8,3,14,3,12,3,0,3,10,12,14,12,12,17,10,22,14,22,12,15,30,5,10,10,14,5,10,3,26,10,14,10,12,0,16,0,0,76,11,92,13,80,15,99,15,89,15,108,15,97,15,119,15,104,15,123,15,108,15,126,13,113,11,126,9,113,7,126,7,113,5,127,5,113,5,127,5,113,3,127,3,113,3,127,3,113,3,127,3,113,3,127,1,64,1,64,1,64,1,64,1,0,4,0,0,239,9,235,13,230,15,221,15,213,15,213,15,217,15,220,11,215,7,193,1,213,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,0,4,0,0,137,89,142,91,
|
||
|
134,91,138,91,141,91,133,91,145,91,135,91,140,91,132,91,137,91,145,89,136,87,141,83,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,128,81,0,3,0,0,223,94,216,94,231,94,231,0,231,0,228,0,221,0,230,0,234,0,220,0,217,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,1,16,0,0,105,71,105,75,105,79,93,9,98,15,98,13,88,15,88,15,88,13,88,1,88,15,88,13,64,1,86,15,86,47,86,45,103,67,103,71,103,75,103,79,95,15,95,13,95,1,83,5,91,27,117,7,112,13,100,9,105,15,105,13,98,15,98,13,1,16,0,0,10,14,10,10,15,30,15,10,10,12,10,8,17,14,17,10,7,0,7,0,17,14,17,10,7,12,7,8,0,0,0,0,10,14,10,10,15,14,15,10,10,12,10,8,19,30,19,10,0,0,0,0,19,14,19,10,
|
||
|
15,14,15,10,0,0,0,0,1,16,0,32,34,8,34,6,34,4,27,18,36,8,36,6,39,10,31,4,43,8,34,4,39,10,34,4,41,8,41,6,41,4,22,2,34,8,34,6,43,8,27,6,36,40,36,38,39,8,24,6,29,8,29,6,31,42,31,40,31,6,29,20,29,8,29,6,0,32,0,0,193,15,193,95,191,85,187,1,188,1,187,1,191,85,177,1,163,11,163,91,188,1,0,0,191,85,0,0,193,95,193,1,193,15,193,95,191,1,191,1,191,85,0,0,191,85,0,0,163,11,163,91,0,0,0,0,191,85,0,0,0,0,0,0,1,8,0,32,74,8,74,6,74,4,81,6,81,4,81,2,91,8,91,6,88,42,88,40,88,38,83,8,83,8,83,6,83,4,83,2,79,8,79,6,79,4,81,6,81,4,81,2,86,40,86,38,83,10,83,8,83,6,83,4,83,2,83,2,83,2,83,0,0,32,0,32,238,11,247,11,238,7,247,7,238,5,247,5,238,3,247,3,226,11,235,11,226,7,235,7,221,11,228,11,221,7,228,7,223,11,231,11,223,7,231,7,
|
||
|
223,5,231,5,233,11,240,11,233,7,240,7,233,5,240,5,233,3,240,3,233,3,240,3,0,16,0,32,216,15,245,15,245,15,245,13,245,11,245,9,245,7,245,5,245,3,245,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,192,1,0,6,0,0,41,11,245,3,41,9,245,3,41,7,247,3,41,5,247,3,34,11,245,3,34,9,39,11,252,3,39,9,252,3,39,5,46,11,245,3,46,9,245,3,46,7,247,3,46,5,247,3,46,3,36,9,43,11,245,3,41,11,252,3,41,9,252,3,0,24,0,32,69,15,69,15,69,15,69,15,69,15,0,0,69,15,71,15,74,15,74,15,74,15,0,0,74,15,0,0,74,15,67,15,69,15,69,15,69,15,0,0,69,15,69,15,69,15,0,0,74,15,71,15,76,15,76,15,79,15,0,0,74,15,71,15,0,24,0,32,187,87,174,1,187,85,0,0,187,83,0,0,0,0,179,1,179,9,179,7,179,5,179,3,
|
||
|
179,3,191,1,191,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,0,16,36,11,240,3,43,11,240,3,36,9,240,1,43,9,247,1,36,5,250,3,43,5,250,3,36,3,245,3,43,3,245,3,29,11,243,3,36,11,252,3,29,9,247,3,36,9,243,1,29,5,245,1,36,5,238,3,29,3,238,3,36,3,247,1,0,12,0,32,76,15,76,13,76,11,0,0,81,15,81,13,81,11,76,1,76,15,76,13,79,31,79,13,83,15,83,13,74,15,74,13,76,15,76,13,76,11,0,0,79,15,79,13,79,11,0,0,74,15,74,13,74,11,79,1,81,15,81,13,74,15,74,13,1,24,0,32,76,15,76,13,76,11,0,0,81,15,81,13,81,11,0,0,76,15,76,13,79,31,79,13,83,15,83,13,79,15,79,13,76,15,76,15,76,13,76,13,76,11,76,7,76,1,76,1,76,1,74,1,74,1,74,1,81,1,81,1,74,1,74,1,0,24,0,32,228,31,228,15,228,45,228,43,
|
||
|
58,2,58,2,216,43,58,2,53,2,53,2,216,43,53,2,216,11,55,0,55,0,55,0,226,31,226,47,226,45,226,1,223,31,223,47,223,45,228,1,226,31,226,47,226,45,192,1,231,31,231,47,231,45,192,1,0,12,0,32,228,31,228,15,228,45,228,43,58,2,58,2,216,11,58,2,53,2,53,2,216,11,53,2,216,11,216,1,216,1,192,1,223,31,223,15,223,45,223,43,216,1,192,1,216,27,219,1,226,31,226,15,226,45,226,43,55,34,55,34,55,34,55,32,0,12,0,32,228,31,228,15,228,47,228,47,228,45,228,43,228,41,228,39,228,37,228,35,192,1,192,1,192,1,192,1,192,1,192,1,46,0,46,0,46,2,46,2,53,2,53,2,51,18,51,2,43,2,43,2,43,2,43,0,48,2,48,34,48,34,48,34,0,12,0,0,204,38,204,38,204,36,204,36,204,34,204,34,204,34,204,32,204,38,204,38,204,36,204,36,204,34,204,34,204,34,204,32,199,38,199,38,199,36,199,36,199,34,199,34,199,34,199,32,202,38,202,38,202,36,202,36,202,34,202,34,
|
||
|
202,34,202,32,0,12,0,32,204,6,204,6,204,4,204,4,204,2,204,2,204,2,58,0,204,6,204,6,204,4,204,4,204,2,204,2,204,2,63,0,202,6,202,4,211,6,211,4,199,6,199,4,199,2,209,0,202,6,202,4,202,2,60,0,207,6,207,4,207,2,58,0,0,12,0,0,179,85,154,81,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,4,0,0,204,6,204,6,204,6,204,4,204,4,204,4,204,2,204,2,204,2,204,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,202,0,202,0,202,0,202,0,202,22,202,6,195,20,195,4,0,12,0,0,204,10,204,8,204,6,204,4,207,10,207,8,207,6,207,4,216,10,216,8,211,10,211,8,216,10,211,10,214,8,221,12,226,14,226,14,226,12,226,10,226,8,226,4,
|
||
|
211,0,211,0,216,0,216,0,211,0,211,0,214,0,214,0,221,0,221,0,0,16,0,0,164,94,171,94,176,94,164,92,171,92,176,92,164,90,171,90,176,90,164,88,171,88,176,88,164,86,171,86,176,86,164,84,171,84,176,84,164,82,171,82,176,82,164,80,171,80,176,80,164,80,171,80,176,80,186,80,174,80,128,80,128,80,128,80,0,12,0,0,175,91,1,94,1,94,191,83,1,94,191,83,175,91,1,94,1,94,191,83,1,94,191,83,175,91,191,83,1,94,191,83,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,16,0,16,150,14,150,14,159,30,159,14,159,14,159,14,152,30,152,14,147,30,147,14,157,30,157,14,150,30,150,14,150,14,150,14,155,30,155,14,155,14,155,14,0,0,155,0,0,0,155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,100,95,112,95,100,89,112,89,91,93,103,93,95,95,107,95,95,89,107,89,95,87,107,87,95,85,107,85,
|
||
|
95,83,107,83,91,95,103,95,91,89,103,89,91,87,103,87,93,95,105,95,93,89,105,89,93,87,105,87,95,95,107,95,95,89,107,89,0,8,0,32,140,92,140,92,140,90,140,90,140,88,140,88,140,86,138,22,143,92,143,92,143,90,143,90,143,88,143,88,143,86,150,22,147,92,147,92,147,90,147,90,147,88,147,88,147,86,147,86,147,84,135,8,150,14,147,28,147,10,147,40,143,12,143,10,0,32,0,32,135,94,135,92,135,90,135,88,143,92,143,90,140,94,140,92,140,90,140,88,140,86,140,84,135,94,135,92,135,90,135,88,135,94,135,92,135,90,135,88,140,92,140,90,145,94,145,92,145,90,145,88,147,92,147,90,150,94,150,92,150,90,150,88,0,16,0,0,95,15,107,15,95,9,107,9,88,11,100,11,91,15,103,15,91,9,103,9,88,15,100,15,88,9,100,9,88,7,100,7,91,15,103,15,91,9,103,9,93,7,105,7,93,5,105,5,95,15,107,15,95,9,107,9,95,7,107,7,91,11,103,11,0,8,0,32,145,94,145,92,145,90,145,88,147,92,147,90,
|
||
|
152,94,152,92,152,90,152,88,157,92,157,90,143,92,152,88,147,94,150,90,143,94,143,92,143,90,143,88,145,92,145,90,150,94,150,92,150,90,150,88,155,92,155,90,162,94,159,88,152,92,147,86,0,16,0,32,1,94,175,91,1,94,191,83,175,91,191,83,1,94,191,83,1,94,191,83,175,91,1,94,175,91,191,83,1,94,191,83,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,16,0,16,1,94,1,94,1,94,191,83,175,91,191,83,191,83,1,94,1,94,191,83,1,94,191,83,175,91,191,83,175,91,191,83,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,80,0,16,0,16,41,8,41,8,41,6,43,22,41,68,43,20,41,66,43,18,51,72,48,24,46,72,46,6,48,72,48,6,43,24,43,6,46,72,46,8,46,6,48,22,46,68,48,20,46,68,48,20,43,72,46,24,43,70,46,20,43,72,43,8,41,22,41,36,
|
||
|
0,32,0,0,100,83,100,83,100,85,100,85,100,87,100,87,100,89,100,89,100,91,100,91,100,93,100,93,100,95,64,81,100,95,64,81,100,93,64,81,100,93,64,81,100,91,64,81,100,91,64,81,100,89,64,81,100,87,64,81,100,85,64,81,100,83,64,81,0,8,0,32,95,83,95,83,95,85,95,85,95,87,95,87,95,89,95,89,95,91,95,91,95,93,95,93,95,95,0,80,95,95,0,80,95,93,0,80,95,93,0,80,95,91,0,80,95,91,0,80,95,89,0,80,95,87,0,80,95,85,0,80,95,83,0,80,0,8,0,32,195,7,197,23,199,25,204,25,211,27,219,29,228,14,240,30,103,15,110,31,228,14,240,30,103,15,110,31,228,12,240,28,103,13,110,29,228,10,240,26,103,11,110,27,228,8,240,24,103,9,110,25,228,6,240,22,103,5,110,21,228,2,240,18,0,5,0,0,140,94,140,92,140,90,140,88,140,86,138,92,138,90,138,88,143,94,143,92,143,90,143,88,143,86,140,92,140,90,140,88,140,94,140,92,140,90,140,88,140,86,138,92,138,90,138,88,
|
||
|
143,94,143,92,143,90,143,88,143,86,145,92,145,90,145,88,0,32,0,32,147,94,147,92,147,90,147,88,147,86,145,92,145,90,145,88,150,94,150,92,150,90,150,88,150,86,147,92,147,90,147,88,147,94,147,92,147,90,147,88,147,86,143,92,143,90,143,88,140,10,145,22,150,92,143,88,150,46,150,42,140,14,140,90,0,32,0,0,223,6,235,6,98,7,105,7,223,4,235,4,98,5,105,5,223,2,235,2,98,3,105,3,223,0,235,0,98,1,105,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,233,90,192,0,233,88,240,14,240,12,240,90,211,80,228,0,228,80,192,0,211,80,228,0,228,80,192,0,192,0,228,0,228,80,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,0,11,0,0,124,95,124,89,124,87,124,85,124,83,124,83,119,91,119,89,122,95,122,91,122,89,122,87,122,85,122,85,122,83,122,83,
|
||
|
117,95,117,91,117,89,117,89,117,87,117,87,117,85,117,85,117,83,117,83,115,95,115,91,115,89,115,87,115,85,115,83,0,16,0,0,117,95,117,91,117,89,117,87,117,85,117,85,117,83,117,83,119,91,119,87,115,95,115,91,115,89,115,87,115,85,115,85,122,95,122,89,122,87,122,85,122,83,122,83,115,95,115,91,115,89,115,89,115,87,115,87,115,85,115,85,115,83,115,83,0,16,0,0,12,12,12,6,12,10,12,6,12,10,12,6,12,2,12,0,12,12,12,6,12,10,12,6,12,10,12,6,12,2,15,0,17,12,17,6,17,10,17,6,17,2,17,0,10,12,10,6,10,10,10,6,10,10,10,6,10,10,10,6,10,2,0,0,0,16,0,32,5,12,5,6,5,10,5,6,5,2,5,0,7,12,7,6,7,10,7,6,7,2,0,0,15,12,15,6,15,2,0,0,12,12,12,6,12,10,12,6,12,10,12,6,12,10,12,6,12,10,12,6,12,2,0,0,12,12,12,6,12,2,12,0,0,16,0,0,131,85,164,83,128,81,131,83,164,85,155,83,162,85,131,83,
|
||
|
128,81,131,83,145,85,179,83,162,85,128,81,157,85,138,83,183,85,152,83,174,85,157,83,128,81,183,83,183,85,152,83,174,85,157,83,145,85,131,83,128,81,131,83,164,85,157,83,0,16,0,0,178,3,178,3,178,3,178,3,177,3,177,3,176,3,174,3,170,3,165,3,155,3,147,3,143,3,141,3,140,3,140,3,140,3,140,3,140,3,143,3,148,3,157,3,164,3,170,3,174,3,176,3,177,3,179,3,179,3,180,3,180,3,180,3,0,16,0,32,176,88,176,80,176,86,179,84,171,86,176,80,176,84,176,80,176,80,176,84,176,80,176,80,176,82,176,80,176,80,176,82,171,88,171,80,171,86,167,84,169,86,171,80,171,84,171,80,171,80,171,84,171,80,171,80,171,82,171,80,171,80,171,82,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,
|
||
|
0,112,120,97,13,201,4,111,235,193,226,221,39,95,127,119,116,246,253,135,71,27,193,229,175,240,0,221,43,156,95,70,105,147,20,209,237,239,144,189,194,27,228,151,156,210,199,65,148,117,143,240,12,213,125,197,91,188,134,25,70,194,240,49,102,70,38,60,191,120,97,232,49,178,210,237,188,234,49,220,113,222,117,126,71,230,135,219,26,191,99,164,85,12,57,112,167,237,119,164,199,51,160,61,162,58,164,77,240,14,123,107,193,74,54,217,110,164,117,48,101,156,189,153,157,166,207,212,6,68,71,218,167,72,246,206,91,186,112,173,216,60,175,221,82,12,255,22,210,137,98,96,69,42,124,3,97,120,160,164,137,194,249,20,200,187,19,86,93,23,42,31,89,77,236,204,240,18,60,147,14,63,220,111,157,129,58,28,138,134,38,38,70,179,234,37,202,206,16,242,232,153,210,67,112,132,254,137,80,240,132,80,248,119,160,80,248,181,160,40,254,12,42,138,159,39,10,133,127,138,226,174,157,125,103,156,231,138,237,42,4,194,125,104,147,150,87,74,132,207,15,42,226,220,82,17,
|
||
|
95,160,34,254,4,42,226,13,84,4,197,8,21,19,102,210,231,73,53,211,163,64,35,64,235,54,121,41,165,89,215,163,118,61,2,215,99,125,175,216,216,88,153,138,244,12,93,57,180,52,24,108,102,147,89,105,235,46,45,211,181,82,108,208,30,155,157,45,7,119,218,241,161,197,3,157,19,102,105,237,42,225,52,75,61,67,249,16,114,55,130,228,168,70,250,174,177,246,138,245,19,40,193,71,114,252,24,233,39,22,156,61,218,36,229,174,27,53,226,124,14,201,150,52,15,5,203,35,43,190,168,13,132,201,22,98,111,105,135,199,37,162,245,167,198,61,102,135,124,22,181,217,1,182,143,10,250,171,204,40,131,234,169,176,233,119,186,124,40,243,69,150,11,108,136,202,172,47,11,151,42,178,87,98,66,17,93,43,153,124,56,108,31,33,247,103,120,202,154,165,76,171,220,251,39,18,44,160,254,12,94,144,180,242,77,229,228,138,120,228,114,184,168,226,50,181,176,178,51,37,211,46,247,233,240,202,202,255,18,150,255,163,81,162,108,46,121,88,37,172,93,187,8,66,203,146,
|
||
|
103,32,20,38,255,111,146,8,150,42,255,39,73,254,199,93,130,61,170,30,58,228,63,74,29,242,255,151,64,186,117,200,255,255,83,133,87,146,40,176,31,130,253,80,98,143,134,57,148,20,21,212,95,97,247,87,65,253,211,147,255,171,243,42,200,173,94,126,139,151,255,255,41,192,44,188,254,202,151,255,135,50,125,228,203,255,255,241,161,44,47,222,5,10,114,57,118,209,81,244,16,142,173,192,8,51,11,83,8,32,78,58,8,255,127,138,206,170,228,99,55,90,159,199,151,112,99,134,184,40,38,124,106,255,144,9,209,33,38,157,240,151,93,196,33,88,204,27,226,166,156,16,236,9,255,105,39,162,15,79,25,236,108,77,165,67,187,39,110,116,147,167,214,213,88,48,91,14,21,233,202,214,88,185,100,161,173,133,185,249,116,178,89,169,55,213,194,39,150,164,23,52,108,37,185,160,41,185,240,63,242,103,122,97,82,232,84,25,232,199,101,198,169,104,78,193,114,115,150,192,130,221,54,172,176,96,69,105,28,87,118,83,153,134,248,169,129,14,113,135,185,116,106,64,148,157,
|
||
|
58,201,10,225,178,254,85,44,228,201,104,179,17,212,167,206,229,59,30,217,79,146,149,54,15,246,204,207,11,116,13,166,134,195,80,219,96,58,220,8,211,212,62,253,64,212,88,111,196,26,70,26,18,63,152,172,170,93,123,171,6,217,194,240,173,242,189,11,28,123,128,214,138,250,136,79,188,48,158,247,225,98,60,27,37,3,42,227,8,189,211,106,4,198,26,225,135,24,169,124,200,142,7,118,124,208,120,97,96,32,79,54,70,180,138,237,21,218,51,176,63,228,131,85,8,75,31,137,143,47,92,180,115,80,216,69,179,84,126,48,122,141,137,90,71,41,118,77,160,33,22,46,5,114,232,144,59,87,17,136,75,108,245,70,217,209,91,143,255,83,249,55,242,255,219,106,165,233,135,255,12,140,164,31,46,161,36,129,204,189,165,50,136,167,154,186,88,89,28,207,86,154,93,189,11,233,135,90,232,33,113,206,180,172,146,238,252,189,168,248,59,53,76,233,225,199,98,222,246,107,189,236,229,106,48,189,101,2,217,141,108,98,171,232,39,3,120,15,3,87,17,149,39,169,16,55,
|
||
|
12,185,77,243,205,29,75,238,211,161,178,199,84,211,101,59,35,78,25,53,110,154,250,98,38,148,243,135,57,182,138,108,107,112,89,79,100,176,138,71,214,28,177,17,137,213,153,99,175,144,53,115,199,200,96,162,44,154,4,133,4,233,74,33,22,231,154,149,66,195,198,53,27,197,154,182,142,105,38,84,252,163,161,180,185,59,208,15,14,14,14,21,217,172,172,114,212,192,82,192,220,226,114,148,156,90,76,88,79,187,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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ined" ? Module : {};
|
||
|
|
||
|
if (!Module.expectedDataFileDownloads) {
|
||
|
Module.expectedDataFileDownloads = 0;
|
||
|
Module.finishedDataFileDownloads = 0;
|
||
|
}
|
||
|
|
||
|
Module.expectedDataFileDownloads++;
|
||
|
|
||
|
(function() {
|
||
|
var loadPackage = function(metadata) {
|
||
|
function runWithFS() {
|
||
|
var fileData0 = [];
|
||
|
fileData0.push.apply(fileData0, [ 67, 80, 79, 68, 68, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 70, 73, 76, 0, 0, 0, 0, 123, 144, 0, 0, 112, 111, 100, 47, 112, 105, 99, 111, 56, 95, 98, 111, 111, 116, 46, 112, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 1, 0, 0, 242, 16, 112, 105, 99, 111, 45, 56, 32, 99, 97, 114, 116, 114, 105, 100, 103, 101, 32, 47, 47, 32, 104, 116, 116, 112, 58, 47, 47, 119, 119, 119, 46, 31, 0, 255, 13, 46, 99, 111, 109, 10, 118, 101, 114, 115, 105, 111, 110, 32, 56, 10, 95, 95, 108, 117, 97, 95, 95, 10, 10, 45, 45, 62, 56, 6, 0, 25, 159, 95, 95, 103, 102, 120, 95, 95, 10, 48, 1, 0, 108, 15, 129, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 45, 1, 137, 64, 31, 102, 137, 64, 112, 15, 139, 1, 109, 15, 1, 1, 239, 95, 95, 95, 109, 97, 112, 10, 2, 240, 15, 1, 1, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 44, 50, 95, 95, 115, 187, 98, 48, 49, 48, 99, 17, 0, 161, 51, 48, 53, 53, 53, 50, 98, 53, 54, 53, 10, 0, 64, 51, 53, 53, 52, 5, 0, 128, 49, 53, 51, 53, 55, 48, 53, 48, 3, 0, 15, 5, 0, 106, 0, 169, 0, 16, 56, 12, 0, 115, 50, 52, 48, 51, 53, 50, 52, 26, 0, 15, 91, 2, 130, 30, 49, 154, 0, 15, 169, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 238, 113, 95, 95, 109, 117, 115, 105, 99, 114, 74, 50, 32, 52, 49, 2, 0, 15, 12, 0, 255, 255, 224, 80, 49, 52, 49, 10, 10, 99, 70, 73, 76, 0, 0, 0, 0, 27, 189, 12, 0, 112, 111, 100, 47, 103, 102, 120, 49, 46, 112, 111, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 74, 0, 0, 243, 22, 67, 80, 79, 68, 68, 0, 0, 0, 1, 0, 0, 0, 103, 102, 120, 49, 46, 112, 111, 100, 0, 47, 112, 97, 98, 97, 47, 112, 105, 99, 111, 56, 47, 112, 111, 100, 47, 25, 0, 63, 9, 1, 0, 1, 0, 10, 177, 67, 66, 77, 80, 20, 0, 1, 0, 128, 0, 0, 4, 0, 47, 32, 0, 1, 0, 255, 255, 255, 255, 255, 255, 255, 255, 207, 79, 77, 0, 255, 255, 4, 0, 73, 47, 0, 0, 0, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 91, 63, 163, 255, 255, 4, 0, 73, 47, 232, 241, 4, 0, 75, 47, 170, 204, 4, 0, 75, 15, 0, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 155, 79, 39, 236, 255, 255, 4, 0, 73, 47, 232, 241, 4, 0, 255, 12, 47, 168, 119, 4, 0, 75, 15, 0, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 59, 15, 1, 0, 77, 79, 54, 228, 0, 255, 4, 0, 73, 15, 160, 1, 77, 63, 156, 118, 131, 4, 0, 74, 15, 160, 1, 77, 15, 0, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 155, 15, 1, 0, 77, 79, 255, 173, 41, 255, 4, 0, 73, 15, 99, 1, 77, 15, 0, 2, 255, 255, 255, 255, 255, 255,
|
||
|
fileData0.push.apply(fileData0, [ 88, 0, 39, 0, 56, 43, 38, 0, 155, 16, 0, 4, 76, 43, 4, 116, 0, 0, 48, 2, 4, 184, 19, 15, 192, 0, 49, 47, 177, 217, 0, 5, 255, 252, 4, 148, 208, 8, 84, 11, 4, 144, 2, 12, 56, 22, 15, 116, 0, 51, 15, 128, 92, 255, 160, 31, 168, 40, 45, 88, 15, 56, 22, 9, 15, 108, 0, 48, 15, 0, 10, 255, 255, 8, 8, 128, 2, 47, 177, 217, 80, 116, 11, 15, 88, 7, 0, 15, 0, 5, 21, 15, 128, 7, 255, 255, 24, 15, 80, 116, 20, 15, 128, 2, 255, 255, 48, 15, 128, 12, 3, 15, 208, 113, 6, 15, 128, 2, 255, 151, 14, 152, 1, 15, 48, 2, 75, 31, 177, 52, 17, 7, 15, 56, 22, 54, 15, 212, 0, 8, 15, 128, 2, 255, 123, 12, 148, 62, 15, 176, 14, 85, 31, 177, 52, 17, 60, 4, 4, 0, 14, 248, 19, 15, 128, 2, 255, 144, 8, 200, 6, 31, 177, 48, 12, 72, 14, 192, 4, 14, 52, 17, 15, 200, 5, 80, 15, 128, 7, 255, 215, 15, 128, 2, 1, 4, 52, 7, 12, 12, 0, 0, 180, 14, 15, 200, 0, 85, 14, 236, 7, 15, 128, 12, 255, 196, 15, 128, 7, 4, 15, 52, 17, 78, 15, 124, 2, 8, 14, 112, 10, 15, 128, 2, 255, 201, 4, 128, 12, 4, 8, 0, 42, 0, 155, 20, 0, 15, 52, 17, 69, 15, 120, 2, 8, 15, 248, 12, 5, 15, 128, 17, 255, 203, 42, 0, 155, 128, 7, 4, 8, 5, 15, 52, 17, 24, 15, 120, 2, 70, 14, 136, 2, 15, 0, 20, 255, 200, 8, 8, 10, 15, 52, 17, 41, 14, 184, 4, 15, 120, 2, 47, 14, 136, 2, 15, 128, 2, 255, 28, 14, 116, 36, 15, 128, 2, 139, 12, 188, 0, 15, 108, 37, 44, 15, 116, 2, 1, 15, 132, 2, 45, 15, 128, 2, 255, 15, 15, 248, 38, 4, 15, 136, 12, 158, 15, 244, 4, 20, 15, 4, 0, 97, 15, 128, 2, 254, 15, 200, 8, 20, 15, 56, 27, 146, 14, 128, 2, 15, 124, 2, 6, 15, 128, 2, 230, 15, 100, 57, 12, 15, 4, 0, 255, 207, 15, 0, 5, 125, 15, 176, 26, 44, 15, 104, 6, 65, 15, 20, 5, 45, 15, 228, 5, 145, 15, 128, 7, 246, 14, 176, 26, 15, 104, 1, 78, 15, 148, 2, 218, 15, 188, 0, 25, 4, 180, 59, 4, 192, 27, 15, 128, 7, 255, 255, 35, 15, 76, 1, 41, 12, 64, 30, 15, 128, 7, 196, 15, 4, 0, 255, 71, 15, 204, 8, 27, 15, 64, 30, 79, 15, 4, 0, 0, 15, 0, 70, 109, 15, 220, 11, 255, 75, 12, 204, 8, 15, 244, 4, 21, 47, 232, 241, 64, 30, 11, 15, 172, 6, 55, 15, 128, 2, 255, 204, 15, 32, 2, 31, 15, 196, 163, 30, 15, 128, 2, 255, 243, 15, 48, 11, 57, 15, 196, 163, 36, 15, 0, 10, 255, 231, 15, 176, 18, 16, 15, 116, 47, 61, 15, 0, 10, 255, 251, 14, 228, 9, 15, 100, 0, 63, 0, 120, 7, 15, 192, 0, 12, 15, 128, 7, 209, 15, 172, 17, 9, 15, 128, 7, 255, 55, 15, 96, 1, 4, 15, 128, 2, 255, 3, 12, 124, 6, 14, 176, 27, 15, 92, 10, 255, 124, 15, 128, 2, 193, 14, 124, 6, 15, 0, 30, 255, 255, 29, 15, 160, 3, 56, 15, 128, 2, 255, 255, 100, 14, 4, 0, 15, 128, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 169, 63, 255, 155, 63, 4, 0, 255, 235, 15, 128, 2, 255, 94, 4, 176, 20, 15, 128, 2, 255, 255, 99, 12, 48, 28, 15, 128, 2, 255, 255, 99, 8, 48, 28, 15, 128, 2, 255, 255, 31, 14, 60, 7, 15, 128, 7, 255, 204, 8, 40, 13, 15, 248, 0, 61, 14, 92, 0, 15, 60, 7, 255, 0, 14, 128, 1, 15, 0, 5, 255, 12, 12, 44, 1, 14, 56, 1, 15, 56, 0, 22, 15, 60, 7, 13, 15, 8, 2, 101, 15, 0, 5, 255, 91, 15, 160, 1, 25, 14, 72, 2, 15, 56, 0, 30, 15, 60, 7, 21, 15, 32, 3, 61, 15, 0, 10, 255, 199, 14, 52, 4, 15, 56, 0, 30, 15, 32, 3, 77, 15, 128, 2, 255, 187, 12, 220, 1, 14, 72, 2, 15, 56, 0, 30, 15, 32, 3, 81, 15, 0, 5, 255, 191, 15, 8, 10, 56, 15, 32, 3, 61, 15, 128, 2, 255, 227, 15, 144, 4, 89, 14, 44, 12, 15, 232, 2, 79, 8, 32, 62, 15, 32, 0, 8, 15, 80, 0, 34, 15, 4, 0, 20, 15, 128, 2, 186, 14, 212, 0, 15, 80, 19, 14, 15, 0, 20, 154, 14, 8, 10, 15, 0, 30, 255, 255, 89, 14, 4, 0, 15, 128, 2, 255, 255, 255, 250, 15, 32, 38, 0, 15, 0, 5, 255, 255, 255, 133, 15, 168, 3, 0, 15, 128, 2, 255, 135, 15, 84, 5, 20, 15, 8, 3, 255, 54, 15, 128, 12, 255, 255, 111, 15, 128, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 48, 15, 4, 0, 255, 242, 15, 128, 2, 56, 15, 4, 0, 255, 255, 35, 15, 128, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 252, 63, 54, 54, 54, 4, 0, 255, 243, 15, 128, 2, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||
|
fileData0.push.apply(fileData0, [ 51, 1, 15, 151, 11, 21, 15, 237, 11, 20, 47, 0, 255, 210, 19, 24, 15, 14, 7, 15, 47, 255, 0, 88, 1, 22, 5, 177, 5, 15, 145, 8, 17, 5, 196, 12, 15, 10, 5, 4, 15, 35, 16, 4, 0, 43, 0, 95, 55, 0, 0, 0, 7, 208, 18, 15, 15, 1, 0, 1, 15, 63, 0, 10, 15, 2, 0, 15, 15, 63, 0, 11, 9, 132, 0, 8, 197, 8, 4, 70, 3, 15, 63, 0, 9, 7, 136, 18, 7, 68, 22, 3, 246, 19, 15, 63, 0, 15, 5, 91, 6, 2, 57, 0, 15, 14, 0, 1, 15, 126, 0, 10, 4, 152, 6, 24, 255, 131, 12, 5, 161, 1, 15, 63, 0, 16, 5, 55, 0, 27, 255, 253, 16, 3, 28, 0, 15, 252, 0, 12, 47, 0, 255, 56, 0, 4, 3, 155, 0, 15, 126, 0, 19, 5, 113, 1, 4, 124, 1, 14, 126, 0, 15, 189, 0, 7, 7, 245, 0, 7, 126, 0, 31, 255, 252, 0, 24, 6, 255, 3, 7, 65, 9, 15, 248, 1, 21, 27, 255, 248, 1, 31, 0, 248, 1, 19, 43, 255, 255, 39, 2, 5, 181, 1, 15, 244, 2, 17, 8, 232, 0, 6, 7, 2, 9, 16, 1, 15, 181, 2, 26, 7, 0, 25, 15, 244, 2, 17, 7, 54, 3, 31, 0, 248, 1, 33, 15, 37, 4, 4, 6, 1, 0, 15, 189, 0, 20, 7, 122, 0, 3, 219, 16, 15, 189, 0, 29, 7, 135, 1, 25, 255, 74, 19, 15, 248, 1, 12, 10, 238, 0, 10, 10, 1, 15, 55, 2, 20, 10, 189, 0, 15, 122, 1, 22, 5, 221, 2, 4, 229, 5, 25, 255, 53, 22, 15, 63, 0, 19, 9, 135, 16, 2, 227, 16, 15, 122, 1, 26, 11, 82, 21, 15, 244, 2, 26, 15, 14, 0, 2, 15, 232, 5, 23, 15, 7, 0, 2, 15, 232, 5, 16, 14, 177, 1, 22, 255, 69, 22, 2, 12, 0, 15, 169, 5, 16, 6, 92, 4, 7, 109, 13, 47, 0, 255, 122, 1, 16, 5, 156, 3, 3, 155, 5, 8, 186, 3, 14, 236, 4, 15, 181, 2, 4, 27, 255, 197, 0, 6, 232, 10, 31, 0, 252, 0, 15, 25, 255, 237, 6, 6, 152, 25, 31, 255, 244, 2, 15, 8, 69, 23, 6, 114, 22, 11, 217, 25, 15, 110, 4, 10, 12, 123, 1, 24, 255, 230, 6, 15, 181, 2, 14, 3, 253, 0, 7, 241, 4, 3, 80, 1, 14, 228, 6, 15, 251, 22, 7, 8, 120, 0, 9, 128, 14, 15, 189, 0, 19, 8, 4, 14, 4, 163, 25, 15, 110, 4, 26, 29, 255, 77, 14, 15, 169, 5, 16, 15, 7, 0, 2, 15, 55, 2, 33, 7, 61, 1, 4, 59, 1, 15, 126, 0, 17, 7, 27, 30, 28, 255, 189, 0, 15, 161, 7, 17, 7, 245, 0, 6, 71, 0, 5, 64, 0, 15, 252, 0, 16, 7, 67, 0, 40, 255, 255, 3, 1, 15, 110, 4, 16, 8, 52, 1, 43, 255, 255, 18, 1, 31, 0, 232, 5, 19, 13, 127, 1, 5, 140, 2, 15, 63, 0, 20, 9, 160, 5, 15, 181, 2, 21, 11, 184, 0, 31, 255, 118, 2, 28, 5, 135, 8, 5, 59, 1, 8, 133, 2, 15, 189, 0, 15, 6, 44, 3, 4, 237, 4, 7, 246, 4, 31, 0, 169, 5, 14, 43, 0, 255, 46, 6, 7, 187, 13, 5, 187, 12, 15, 126, 0, 10, 11, 244, 16, 6, 63, 27, 14, 248, 1, 15, 118, 2, 4, 7, 216, 5, 40, 0, 255, 41, 5, 47, 0, 255, 244, 2, 16, 5, 116, 20, 11, 14, 0, 15, 106, 5, 13, 24, 255, 96, 4, 12, 110, 4, 15, 51, 3, 19, 15, 191, 3, 0, 6, 252, 6, 47, 0, 255, 90, 9, 18, 43, 255, 255, 77, 29, 5, 59, 2, 15, 98, 7, 12, 12, 203, 11, 27, 0, 192, 30, 15, 27, 9, 21, 28, 255, 179, 6, 6, 138, 15, 15, 78, 12, 9, 29, 0, 118, 4, 6, 244, 3, 15, 11, 13, 17, 11, 56, 2, 7, 144, 1, 15, 51, 3, 16, 15, 25, 8, 0, 7, 146, 13, 31, 255, 39, 6, 19, 29, 255, 14, 0, 31, 255, 236, 4, 17, 4, 142, 7, 8, 120, 1, 6, 183, 1, 47, 255, 0, 177, 3, 17, 41, 0, 0, 193, 12, 10, 51, 7, 15, 70, 14, 21, 13, 196, 0, 14, 161, 7, 15, 102, 6, 6, 10, 6, 2, 15, 244, 2, 22, 11, 147, 7, 9, 229, 5, 15, 106, 5, 25, 11, 245, 2, 47, 255, 255, 185, 1, 18, 40, 0, 255, 203, 14, 9, 16, 10, 7, 104, 17, 15, 126, 0, 30, 14, 55, 2, 15, 236, 4, 26, 15, 157, 8, 23, 24, 0, 29, 7, 41, 255, 255, 171, 5, 14, 70, 14, 15, 252, 0, 3, 9, 53, 4, 6, 68, 2, 15, 122, 1, 2, 15, 201, 13, 7, 11, 47, 7, 15, 7, 14, 21, 15, 250, 2, 5, 15, 70, 14, 21, 9, 102, 4, 6, 191, 15, 15, 63, 0, 26, 7, 253, 0, 15, 66, 15, 26, 7, 192, 2, 28, 255, 80, 1, 15, 126, 0, 13, 44, 255, 255, 185, 15, 15, 240, 3, 23, 10, 216, 9, 47, 255, 0, 51, 3, 38, 13, 119, 0, 15, 196, 14, 17, 11, 209, 9, 5, 202, 0, 6, 238, 6, 15, 114, 3, 19, 8, 242, 1, 7, 145, 11, 31, 255, 252, 0, 25, 14, 14, 0, 15, 149, 10, 20, 12, 209, 10, 47, 255, 0, 43, 5, 29, 5, 187, 22, 14, 244, 2, 15, 55, 2, 21, 9, 7, 0, 15, 122, 1, 5, 15, 146, 11, 14, 31, 0, 35, 7, 21, 7, 93, 8, 9, 79, 11, 5, 211, 10, 15, 189, 0, 28, 8, 100, 7, 14, 70, 14, 15, 248, 1, 18, 15, 15, 12, 27, 8, 34, 4, 15, 189, 0, 35, 5, 38, 4, 28, 255, 190, 0, 15, 172, 20, 18, 14, 81, 13, 15, 173, 4, 19, 8, 153, 29, 15, 189, 0, 32, 7, 93, 5, 15, 126
|
||
|
Module["FS_createDataFile"]("/", "data.pod", fileData0, true, true, false);
|
||
|
}
|
||
|
if (Module["calledRun"]) {
|
||
|
runWithFS();
|
||
|
} else {
|
||
|
if (!Module["preRun"]) Module["preRun"] = [];
|
||
|
Module["preRun"].push(runWithFS);
|
||
|
}
|
||
|
};
|
||
|
loadPackage({
|
||
|
"files": []
|
||
|
});
|
||
|
})();
|
||
|
|
||
|
var moduleOverrides = {};
|
||
|
|
||
|
var key;
|
||
|
|
||
|
for (key in Module) {
|
||
|
if (Module.hasOwnProperty(key)) {
|
||
|
moduleOverrides[key] = Module[key];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Module["arguments"] = [];
|
||
|
|
||
|
Module["thisProgram"] = "./this.program";
|
||
|
|
||
|
Module["quit"] = function(status, toThrow) {
|
||
|
throw toThrow;
|
||
|
};
|
||
|
|
||
|
Module["preRun"] = [];
|
||
|
|
||
|
Module["postRun"] = [];
|
||
|
|
||
|
var ENVIRONMENT_IS_WEB = false;
|
||
|
|
||
|
var ENVIRONMENT_IS_WORKER = false;
|
||
|
|
||
|
var ENVIRONMENT_IS_NODE = false;
|
||
|
|
||
|
var ENVIRONMENT_IS_SHELL = false;
|
||
|
|
||
|
ENVIRONMENT_IS_WEB = typeof window === "object";
|
||
|
|
||
|
ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
|
||
|
|
||
|
ENVIRONMENT_IS_NODE = typeof process === "object" && typeof require === "function" && !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_WORKER;
|
||
|
|
||
|
ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
|
||
|
|
||
|
var scriptDirectory = "";
|
||
|
|
||
|
function locateFile(path) {
|
||
|
if (Module["locateFile"]) {
|
||
|
return Module["locateFile"](path, scriptDirectory);
|
||
|
} else {
|
||
|
return scriptDirectory + path;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
scriptDirectory = __dirname + "/";
|
||
|
var nodeFS;
|
||
|
var nodePath;
|
||
|
Module["read"] = function shell_read(filename, binary) {
|
||
|
var ret;
|
||
|
ret = tryParseAsDataURI(filename);
|
||
|
if (!ret) {
|
||
|
if (!nodeFS) nodeFS = require("fs");
|
||
|
if (!nodePath) nodePath = require("path");
|
||
|
filename = nodePath["normalize"](filename);
|
||
|
ret = nodeFS["readFileSync"](filename);
|
||
|
}
|
||
|
return binary ? ret : ret.toString();
|
||
|
};
|
||
|
Module["readBinary"] = function readBinary(filename) {
|
||
|
var ret = Module["read"](filename, true);
|
||
|
if (!ret.buffer) {
|
||
|
ret = new Uint8Array(ret);
|
||
|
}
|
||
|
assert(ret.buffer);
|
||
|
return ret;
|
||
|
};
|
||
|
if (process["argv"].length > 1) {
|
||
|
Module["thisProgram"] = process["argv"][1].replace(/\\/g, "/");
|
||
|
}
|
||
|
Module["arguments"] = process["argv"].slice(2);
|
||
|
if (typeof module !== "undefined") {
|
||
|
module["exports"] = Module;
|
||
|
}
|
||
|
process["on"]("uncaughtException", function(ex) {
|
||
|
if (!(ex instanceof ExitStatus)) {
|
||
|
throw ex;
|
||
|
}
|
||
|
});
|
||
|
process["on"]("unhandledRejection", abort);
|
||
|
Module["quit"] = function(status) {
|
||
|
process["exit"](status);
|
||
|
};
|
||
|
Module["inspect"] = function() {
|
||
|
return "[Emscripten Module object]";
|
||
|
};
|
||
|
} else if (ENVIRONMENT_IS_SHELL) {
|
||
|
if (typeof read != "undefined") {
|
||
|
Module["read"] = function shell_read(f) {
|
||
|
var data = tryParseAsDataURI(f);
|
||
|
if (data) {
|
||
|
return intArrayToString(data);
|
||
|
}
|
||
|
return read(f);
|
||
|
};
|
||
|
}
|
||
|
Module["readBinary"] = function readBinary(f) {
|
||
|
var data;
|
||
|
data = tryParseAsDataURI(f);
|
||
|
if (data) {
|
||
|
return data;
|
||
|
}
|
||
|
if (typeof readbuffer === "function") {
|
||
|
return new Uint8Array(readbuffer(f));
|
||
|
}
|
||
|
data = read(f, "binary");
|
||
|
assert(typeof data === "object");
|
||
|
return data;
|
||
|
};
|
||
|
if (typeof scriptArgs != "undefined") {
|
||
|
Module["arguments"] = scriptArgs;
|
||
|
} else if (typeof arguments != "undefined") {
|
||
|
Module["arguments"] = arguments;
|
||
|
}
|
||
|
if (typeof quit === "function") {
|
||
|
Module["quit"] = function(status) {
|
||
|
quit(status);
|
||
|
};
|
||
|
}
|
||
|
} else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
||
|
if (ENVIRONMENT_IS_WORKER) {
|
||
|
scriptDirectory = self.location.href;
|
||
|
} else if (document.currentScript) {
|
||
|
scriptDirectory = document.currentScript.src;
|
||
|
}
|
||
|
if (scriptDirectory.indexOf("blob:") !== 0) {
|
||
|
scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1);
|
||
|
} else {
|
||
|
scriptDirectory = "";
|
||
|
}
|
||
|
Module["read"] = function shell_read(url) {
|
||
|
try {
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open("GET", url, false);
|
||
|
xhr.send(null);
|
||
|
return xhr.responseText;
|
||
|
} catch (err) {
|
||
|
var data = tryParseAsDataURI(url);
|
||
|
if (data) {
|
||
|
return intArrayToString(data);
|
||
|
}
|
||
|
throw err;
|
||
|
}
|
||
|
};
|
||
|
if (ENVIRONMENT_IS_WORKER) {
|
||
|
Module["readBinary"] = function readBinary(url) {
|
||
|
try {
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open("GET", url, false);
|
||
|
xhr.responseType = "arraybuffer";
|
||
|
xhr.send(null);
|
||
|
return new Uint8Array(xhr.response);
|
||
|
} catch (err) {
|
||
|
var data = tryParseAsDataURI(url);
|
||
|
if (data) {
|
||
|
return data;
|
||
|
}
|
||
|
throw err;
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
Module["readAsync"] = function readAsync(url, onload, onerror) {
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open("GET", url, true);
|
||
|
xhr.responseType = "arraybuffer";
|
||
|
xhr.onload = function xhr_onload() {
|
||
|
if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
|
||
|
onload(xhr.response);
|
||
|
return;
|
||
|
}
|
||
|
var data = tryParseAsDataURI(url);
|
||
|
if (data) {
|
||
|
onload(data.buffer);
|
||
|
return;
|
||
|
}
|
||
|
onerror();
|
||
|
};
|
||
|
xhr.onerror = onerror;
|
||
|
xhr.send(null);
|
||
|
};
|
||
|
Module["setWindowTitle"] = function(title) {
|
||
|
document.title = title;
|
||
|
};
|
||
|
} else {}
|
||
|
|
||
|
var out = Module["print"] || (typeof console !== "undefined" ? console.log.bind(console) : typeof print !== "undefined" ? print : null);
|
||
|
|
||
|
var err = Module["printErr"] || (typeof printErr !== "undefined" ? printErr : typeof console !== "undefined" && console.warn.bind(console) || out);
|
||
|
|
||
|
for (key in moduleOverrides) {
|
||
|
if (moduleOverrides.hasOwnProperty(key)) {
|
||
|
Module[key] = moduleOverrides[key];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
moduleOverrides = undefined;
|
||
|
|
||
|
var STACK_ALIGN = 16;
|
||
|
|
||
|
function dynamicAlloc(size) {
|
||
|
var ret = HEAP32[DYNAMICTOP_PTR >> 2];
|
||
|
var end = ret + size + 15 & -16;
|
||
|
if (end <= _emscripten_get_heap_size()) {
|
||
|
HEAP32[DYNAMICTOP_PTR >> 2] = end;
|
||
|
} else {
|
||
|
return 0;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function getNativeTypeSize(type) {
|
||
|
switch (type) {
|
||
|
case "i1":
|
||
|
case "i8":
|
||
|
return 1;
|
||
|
|
||
|
case "i16":
|
||
|
return 2;
|
||
|
|
||
|
case "i32":
|
||
|
return 4;
|
||
|
|
||
|
case "i64":
|
||
|
return 8;
|
||
|
|
||
|
case "float":
|
||
|
return 4;
|
||
|
|
||
|
case "double":
|
||
|
return 8;
|
||
|
|
||
|
default:
|
||
|
{
|
||
|
if (type[type.length - 1] === "*") {
|
||
|
return 4;
|
||
|
} else if (type[0] === "i") {
|
||
|
var bits = parseInt(type.substr(1));
|
||
|
assert(bits % 8 === 0, "getNativeTypeSize invalid bits " + bits + ", type " + type);
|
||
|
return bits / 8;
|
||
|
} else {
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function warnOnce(text) {
|
||
|
if (!warnOnce.shown) warnOnce.shown = {};
|
||
|
if (!warnOnce.shown[text]) {
|
||
|
warnOnce.shown[text] = 1;
|
||
|
err(text);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var jsCallStartIndex = 1;
|
||
|
|
||
|
var functionPointers = new Array(0);
|
||
|
|
||
|
var funcWrappers = {};
|
||
|
|
||
|
function dynCall(sig, ptr, args) {
|
||
|
if (args && args.length) {
|
||
|
return Module["dynCall_" + sig].apply(null, [ ptr ].concat(args));
|
||
|
} else {
|
||
|
return Module["dynCall_" + sig].call(null, ptr);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var tempRet0 = 0;
|
||
|
|
||
|
var setTempRet0 = function(value) {
|
||
|
tempRet0 = value;
|
||
|
};
|
||
|
|
||
|
var getTempRet0 = function() {
|
||
|
return tempRet0;
|
||
|
};
|
||
|
|
||
|
var GLOBAL_BASE = 8;
|
||
|
|
||
|
function getValue(ptr, type, noSafe) {
|
||
|
type = type || "i8";
|
||
|
if (type.charAt(type.length - 1) === "*") type = "i32";
|
||
|
switch (type) {
|
||
|
case "i1":
|
||
|
return HEAP8[ptr >> 0];
|
||
|
|
||
|
case "i8":
|
||
|
return HEAP8[ptr >> 0];
|
||
|
|
||
|
case "i16":
|
||
|
return HEAP16[ptr >> 1];
|
||
|
|
||
|
case "i32":
|
||
|
return HEAP32[ptr >> 2];
|
||
|
|
||
|
case "i64":
|
||
|
return HEAP32[ptr >> 2];
|
||
|
|
||
|
case "float":
|
||
|
return HEAPF32[ptr >> 2];
|
||
|
|
||
|
case "double":
|
||
|
return HEAPF64[ptr >> 3];
|
||
|
|
||
|
default:
|
||
|
abort("invalid type for getValue: " + type);
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
var ABORT = false;
|
||
|
|
||
|
var EXITSTATUS = 0;
|
||
|
|
||
|
function assert(condition, text) {
|
||
|
if (!condition) {
|
||
|
abort("Assertion failed: " + text);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function getCFunc(ident) {
|
||
|
var func = Module["_" + ident];
|
||
|
assert(func, "Cannot call unknown function " + ident + ", make sure it is exported");
|
||
|
return func;
|
||
|
}
|
||
|
|
||
|
function ccall(ident, returnType, argTypes, args, opts) {
|
||
|
var toC = {
|
||
|
"string": function(str) {
|
||
|
var ret = 0;
|
||
|
if (str !== null && str !== undefined && str !== 0) {
|
||
|
var len = (str.length << 2) + 1;
|
||
|
ret = stackAlloc(len);
|
||
|
stringToUTF8(str, ret, len);
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
"array": function(arr) {
|
||
|
var ret = stackAlloc(arr.length);
|
||
|
writeArrayToMemory(arr, ret);
|
||
|
return ret;
|
||
|
}
|
||
|
};
|
||
|
function convertReturnValue(ret) {
|
||
|
if (returnType === "string") return UTF8ToString(ret);
|
||
|
if (returnType === "boolean") return Boolean(ret);
|
||
|
return ret;
|
||
|
}
|
||
|
var func = getCFunc(ident);
|
||
|
var cArgs = [];
|
||
|
var stack = 0;
|
||
|
if (args) {
|
||
|
for (var i = 0; i < args.length; i++) {
|
||
|
var converter = toC[argTypes[i]];
|
||
|
if (converter) {
|
||
|
if (stack === 0) stack = stackSave();
|
||
|
cArgs[i] = converter(args[i]);
|
||
|
} else {
|
||
|
cArgs[i] = args[i];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
var ret = func.apply(null, cArgs);
|
||
|
ret = convertReturnValue(ret);
|
||
|
if (stack !== 0) stackRestore(stack);
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function setValue(ptr, value, type, noSafe) {
|
||
|
type = type || "i8";
|
||
|
if (type.charAt(type.length - 1) === "*") type = "i32";
|
||
|
switch (type) {
|
||
|
case "i1":
|
||
|
HEAP8[ptr >> 0] = value;
|
||
|
break;
|
||
|
|
||
|
case "i8":
|
||
|
HEAP8[ptr >> 0] = value;
|
||
|
break;
|
||
|
|
||
|
case "i16":
|
||
|
HEAP16[ptr >> 1] = value;
|
||
|
break;
|
||
|
|
||
|
case "i32":
|
||
|
HEAP32[ptr >> 2] = value;
|
||
|
break;
|
||
|
|
||
|
case "i64":
|
||
|
tempI64 = [ value >>> 0, (tempDouble = value, +Math_abs(tempDouble) >= +1 ? tempDouble > +0 ? (Math_min(+Math_floor(tempDouble / +4294967296), +4294967295) | 0) >>> 0 : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / +4294967296) >>> 0 : 0) ],
|
||
|
HEAP32[ptr >> 2] = tempI64[0], HEAP32[ptr + 4 >> 2] = tempI64[1];
|
||
|
break;
|
||
|
|
||
|
case "float":
|
||
|
HEAPF32[ptr >> 2] = value;
|
||
|
break;
|
||
|
|
||
|
case "double":
|
||
|
HEAPF64[ptr >> 3] = value;
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
abort("invalid type for setValue: " + type);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var ALLOC_NORMAL = 0;
|
||
|
|
||
|
var ALLOC_NONE = 3;
|
||
|
|
||
|
function allocate(slab, types, allocator, ptr) {
|
||
|
var zeroinit, size;
|
||
|
if (typeof slab === "number") {
|
||
|
zeroinit = true;
|
||
|
size = slab;
|
||
|
} else {
|
||
|
zeroinit = false;
|
||
|
size = slab.length;
|
||
|
}
|
||
|
var singleType = typeof types === "string" ? types : null;
|
||
|
var ret;
|
||
|
if (allocator == ALLOC_NONE) {
|
||
|
ret = ptr;
|
||
|
} else {
|
||
|
ret = [ _malloc, stackAlloc, dynamicAlloc ][allocator](Math.max(size, singleType ? 1 : types.length));
|
||
|
}
|
||
|
if (zeroinit) {
|
||
|
var stop;
|
||
|
ptr = ret;
|
||
|
assert((ret & 3) == 0);
|
||
|
stop = ret + (size & ~3);
|
||
|
for (;ptr < stop; ptr += 4) {
|
||
|
HEAP32[ptr >> 2] = 0;
|
||
|
}
|
||
|
stop = ret + size;
|
||
|
while (ptr < stop) {
|
||
|
HEAP8[ptr++ >> 0] = 0;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
if (singleType === "i8") {
|
||
|
if (slab.subarray || slab.slice) {
|
||
|
HEAPU8.set(slab, ret);
|
||
|
} else {
|
||
|
HEAPU8.set(new Uint8Array(slab), ret);
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
var i = 0, type, typeSize, previousType;
|
||
|
while (i < size) {
|
||
|
var curr = slab[i];
|
||
|
type = singleType || types[i];
|
||
|
if (type === 0) {
|
||
|
i++;
|
||
|
continue;
|
||
|
}
|
||
|
if (type == "i64") type = "i32";
|
||
|
setValue(ret + i, curr, type);
|
||
|
if (previousType !== type) {
|
||
|
typeSize = getNativeTypeSize(type);
|
||
|
previousType = type;
|
||
|
}
|
||
|
i += typeSize;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function getMemory(size) {
|
||
|
if (!runtimeInitialized) return dynamicAlloc(size);
|
||
|
return _malloc(size);
|
||
|
}
|
||
|
|
||
|
var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
|
||
|
|
||
|
function UTF8ArrayToString(u8Array, idx, maxBytesToRead) {
|
||
|
var endIdx = idx + maxBytesToRead;
|
||
|
var endPtr = idx;
|
||
|
while (u8Array[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
||
|
if (endPtr - idx > 16 && u8Array.subarray && UTF8Decoder) {
|
||
|
return UTF8Decoder.decode(u8Array.subarray(idx, endPtr));
|
||
|
} else {
|
||
|
var str = "";
|
||
|
while (idx < endPtr) {
|
||
|
var u0 = u8Array[idx++];
|
||
|
if (!(u0 & 128)) {
|
||
|
str += String.fromCharCode(u0);
|
||
|
continue;
|
||
|
}
|
||
|
var u1 = u8Array[idx++] & 63;
|
||
|
if ((u0 & 224) == 192) {
|
||
|
str += String.fromCharCode((u0 & 31) << 6 | u1);
|
||
|
continue;
|
||
|
}
|
||
|
var u2 = u8Array[idx++] & 63;
|
||
|
if ((u0 & 240) == 224) {
|
||
|
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
||
|
} else {
|
||
|
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | u8Array[idx++] & 63;
|
||
|
}
|
||
|
if (u0 < 65536) {
|
||
|
str += String.fromCharCode(u0);
|
||
|
} else {
|
||
|
var ch = u0 - 65536;
|
||
|
str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return str;
|
||
|
}
|
||
|
|
||
|
function UTF8ToString(ptr, maxBytesToRead) {
|
||
|
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
|
||
|
}
|
||
|
|
||
|
function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {
|
||
|
if (!(maxBytesToWrite > 0)) return 0;
|
||
|
var startIdx = outIdx;
|
||
|
var endIdx = outIdx + maxBytesToWrite - 1;
|
||
|
for (var i = 0; i < str.length; ++i) {
|
||
|
var u = str.charCodeAt(i);
|
||
|
if (u >= 55296 && u <= 57343) {
|
||
|
var u1 = str.charCodeAt(++i);
|
||
|
u = 65536 + ((u & 1023) << 10) | u1 & 1023;
|
||
|
}
|
||
|
if (u <= 127) {
|
||
|
if (outIdx >= endIdx) break;
|
||
|
outU8Array[outIdx++] = u;
|
||
|
} else if (u <= 2047) {
|
||
|
if (outIdx + 1 >= endIdx) break;
|
||
|
outU8Array[outIdx++] = 192 | u >> 6;
|
||
|
outU8Array[outIdx++] = 128 | u & 63;
|
||
|
} else if (u <= 65535) {
|
||
|
if (outIdx + 2 >= endIdx) break;
|
||
|
outU8Array[outIdx++] = 224 | u >> 12;
|
||
|
outU8Array[outIdx++] = 128 | u >> 6 & 63;
|
||
|
outU8Array[outIdx++] = 128 | u & 63;
|
||
|
} else {
|
||
|
if (outIdx + 3 >= endIdx) break;
|
||
|
outU8Array[outIdx++] = 240 | u >> 18;
|
||
|
outU8Array[outIdx++] = 128 | u >> 12 & 63;
|
||
|
outU8Array[outIdx++] = 128 | u >> 6 & 63;
|
||
|
outU8Array[outIdx++] = 128 | u & 63;
|
||
|
}
|
||
|
}
|
||
|
outU8Array[outIdx] = 0;
|
||
|
return outIdx - startIdx;
|
||
|
}
|
||
|
|
||
|
function stringToUTF8(str, outPtr, maxBytesToWrite) {
|
||
|
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
||
|
}
|
||
|
|
||
|
function lengthBytesUTF8(str) {
|
||
|
var len = 0;
|
||
|
for (var i = 0; i < str.length; ++i) {
|
||
|
var u = str.charCodeAt(i);
|
||
|
if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023;
|
||
|
if (u <= 127) ++len; else if (u <= 2047) len += 2; else if (u <= 65535) len += 3; else len += 4;
|
||
|
}
|
||
|
return len;
|
||
|
}
|
||
|
|
||
|
var UTF16Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-16le") : undefined;
|
||
|
|
||
|
function allocateUTF8OnStack(str) {
|
||
|
var size = lengthBytesUTF8(str) + 1;
|
||
|
var ret = stackAlloc(size);
|
||
|
stringToUTF8Array(str, HEAP8, ret, size);
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
function writeArrayToMemory(array, buffer) {
|
||
|
HEAP8.set(array, buffer);
|
||
|
}
|
||
|
|
||
|
function writeAsciiToMemory(str, buffer, dontAddNull) {
|
||
|
for (var i = 0; i < str.length; ++i) {
|
||
|
HEAP8[buffer++ >> 0] = str.charCodeAt(i);
|
||
|
}
|
||
|
if (!dontAddNull) HEAP8[buffer >> 0] = 0;
|
||
|
}
|
||
|
|
||
|
function demangle(func) {
|
||
|
return func;
|
||
|
}
|
||
|
|
||
|
function demangleAll(text) {
|
||
|
var regex = /__Z[\w\d_]+/g;
|
||
|
return text.replace(regex, function(x) {
|
||
|
var y = demangle(x);
|
||
|
return x === y ? x : y + " [" + x + "]";
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function jsStackTrace() {
|
||
|
var err = new Error();
|
||
|
if (!err.stack) {
|
||
|
try {
|
||
|
throw new Error(0);
|
||
|
} catch (e) {
|
||
|
err = e;
|
||
|
}
|
||
|
if (!err.stack) {
|
||
|
return "(no stack trace available)";
|
||
|
}
|
||
|
}
|
||
|
return err.stack.toString();
|
||
|
}
|
||
|
|
||
|
function stackTrace() {
|
||
|
var js = jsStackTrace();
|
||
|
if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"]();
|
||
|
return demangleAll(js);
|
||
|
}
|
||
|
|
||
|
var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
|
||
|
|
||
|
function updateGlobalBufferViews() {
|
||
|
Module["HEAP8"] = HEAP8 = new Int8Array(buffer);
|
||
|
Module["HEAP16"] = HEAP16 = new Int16Array(buffer);
|
||
|
Module["HEAP32"] = HEAP32 = new Int32Array(buffer);
|
||
|
Module["HEAPU8"] = HEAPU8 = new Uint8Array(buffer);
|
||
|
Module["HEAPU16"] = HEAPU16 = new Uint16Array(buffer);
|
||
|
Module["HEAPU32"] = HEAPU32 = new Uint32Array(buffer);
|
||
|
Module["HEAPF32"] = HEAPF32 = new Float32Array(buffer);
|
||
|
Module["HEAPF64"] = HEAPF64 = new Float64Array(buffer);
|
||
|
}
|
||
|
|
||
|
var STACK_BASE = 3042736, DYNAMIC_BASE = 8285616, DYNAMICTOP_PTR = 3042480;
|
||
|
|
||
|
var TOTAL_STACK = 5242880;
|
||
|
|
||
|
var TOTAL_MEMORY = Module["TOTAL_MEMORY"] || 134217728;
|
||
|
|
||
|
if (TOTAL_MEMORY < TOTAL_STACK) err("TOTAL_MEMORY should be larger than TOTAL_STACK, was " + TOTAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")");
|
||
|
|
||
|
if (Module["buffer"]) {
|
||
|
buffer = Module["buffer"];
|
||
|
} else {
|
||
|
{
|
||
|
buffer = new ArrayBuffer(TOTAL_MEMORY);
|
||
|
}
|
||
|
Module["buffer"] = buffer;
|
||
|
}
|
||
|
|
||
|
updateGlobalBufferViews();
|
||
|
|
||
|
HEAP32[DYNAMICTOP_PTR >> 2] = DYNAMIC_BASE;
|
||
|
|
||
|
function callRuntimeCallbacks(callbacks) {
|
||
|
while (callbacks.length > 0) {
|
||
|
var callback = callbacks.shift();
|
||
|
if (typeof callback == "function") {
|
||
|
callback();
|
||
|
continue;
|
||
|
}
|
||
|
var func = callback.func;
|
||
|
if (typeof func === "number") {
|
||
|
if (callback.arg === undefined) {
|
||
|
Module["dynCall_v"](func);
|
||
|
} else {
|
||
|
Module["dynCall_vi"](func, callback.arg);
|
||
|
}
|
||
|
} else {
|
||
|
func(callback.arg === undefined ? null : callback.arg);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var __ATPRERUN__ = [];
|
||
|
|
||
|
var __ATINIT__ = [];
|
||
|
|
||
|
var __ATMAIN__ = [];
|
||
|
|
||
|
var __ATEXIT__ = [];
|
||
|
|
||
|
var __ATPOSTRUN__ = [];
|
||
|
|
||
|
var runtimeInitialized = false;
|
||
|
|
||
|
var runtimeExited = false;
|
||
|
|
||
|
function preRun() {
|
||
|
if (Module["preRun"]) {
|
||
|
if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];
|
||
|
while (Module["preRun"].length) {
|
||
|
addOnPreRun(Module["preRun"].shift());
|
||
|
}
|
||
|
}
|
||
|
callRuntimeCallbacks(__ATPRERUN__);
|
||
|
}
|
||
|
|
||
|
function ensureInitRuntime() {
|
||
|
if (runtimeInitialized) return;
|
||
|
runtimeInitialized = true;
|
||
|
callRuntimeCallbacks(__ATINIT__);
|
||
|
}
|
||
|
|
||
|
function preMain() {
|
||
|
callRuntimeCallbacks(__ATMAIN__);
|
||
|
}
|
||
|
|
||
|
function exitRuntime() {
|
||
|
callRuntimeCallbacks(__ATEXIT__);
|
||
|
runtimeExited = true;
|
||
|
}
|
||
|
|
||
|
function postRun() {
|
||
|
if (Module["postRun"]) {
|
||
|
if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];
|
||
|
while (Module["postRun"].length) {
|
||
|
addOnPostRun(Module["postRun"].shift());
|
||
|
}
|
||
|
}
|
||
|
callRuntimeCallbacks(__ATPOSTRUN__);
|
||
|
}
|
||
|
|
||
|
function addOnPreRun(cb) {
|
||
|
__ATPRERUN__.unshift(cb);
|
||
|
}
|
||
|
|
||
|
function addOnPostRun(cb) {
|
||
|
__ATPOSTRUN__.unshift(cb);
|
||
|
}
|
||
|
|
||
|
var Math_abs = Math.abs;
|
||
|
|
||
|
var Math_ceil = Math.ceil;
|
||
|
|
||
|
var Math_floor = Math.floor;
|
||
|
|
||
|
var Math_min = Math.min;
|
||
|
|
||
|
var runDependencies = 0;
|
||
|
|
||
|
var runDependencyWatcher = null;
|
||
|
|
||
|
var dependenciesFulfilled = null;
|
||
|
|
||
|
function getUniqueRunDependency(id) {
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
function addRunDependency(id) {
|
||
|
runDependencies++;
|
||
|
if (Module["monitorRunDependencies"]) {
|
||
|
Module["monitorRunDependencies"](runDependencies);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function removeRunDependency(id) {
|
||
|
runDependencies--;
|
||
|
if (Module["monitorRunDependencies"]) {
|
||
|
Module["monitorRunDependencies"](runDependencies);
|
||
|
}
|
||
|
if (runDependencies == 0) {
|
||
|
if (runDependencyWatcher !== null) {
|
||
|
clearInterval(runDependencyWatcher);
|
||
|
runDependencyWatcher = null;
|
||
|
}
|
||
|
if (dependenciesFulfilled) {
|
||
|
var callback = dependenciesFulfilled;
|
||
|
dependenciesFulfilled = null;
|
||
|
callback();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Module["preloadedImages"] = {};
|
||
|
|
||
|
Module["preloadedAudios"] = {};
|
||
|
|
||
|
var memoryInitializer = null;
|
||
|
|
||
|
var dataURIPrefix = "data:application/octet-stream;base64,";
|
||
|
|
||
|
function isDataURI(filename) {
|
||
|
return String.prototype.startsWith ? filename.startsWith(dataURIPrefix) : filename.indexOf(dataURIPrefix) === 0;
|
||
|
}
|
||
|
|
||
|
var ASM_CONSTS = [ function() {
|
||
|
if (typeof _cartdat !== "undefined") return 1;
|
||
|
return 0;
|
||
|
}, function() {
|
||
|
return _cartdat.length / 32768;
|
||
|
}, function() {
|
||
|
_cdpos = _cdpos + 1;
|
||
|
return _cartdat[_cdpos - 1];
|
||
|
}, function($0) {
|
||
|
ciii = $0;
|
||
|
iii = 0;
|
||
|
}, function() {
|
||
|
iii = iii + 1;
|
||
|
return _cartname[ciii].charCodeAt(iii - 1);
|
||
|
}, function() {
|
||
|
Module.pico8Reset = function() {
|
||
|
codo_command = 1;
|
||
|
};
|
||
|
Module.pico8ToggleSound = function() {
|
||
|
codo_command = 3;
|
||
|
};
|
||
|
Module.pico8TogglePaused = function() {
|
||
|
codo_command = 4;
|
||
|
};
|
||
|
Module.pico8SetPaused = function(p) {
|
||
|
codo_command = 5;
|
||
|
codo_command_p = 0;
|
||
|
if (p) codo_command_p = 1;
|
||
|
};
|
||
|
Module.pico8ToggleControlMenu = function() {
|
||
|
codo_command = 7;
|
||
|
};
|
||
|
Module.pico8DragOver = function() {
|
||
|
codo_command = 10;
|
||
|
};
|
||
|
Module.pico8DragStop = function() {
|
||
|
codo_command = 11;
|
||
|
};
|
||
|
}, function() {
|
||
|
function mkdir_0(d) {
|
||
|
try {
|
||
|
stat = FS.stat(d);
|
||
|
console.log("found directory: " + d);
|
||
|
} catch (e) {
|
||
|
FS.mkdir(d);
|
||
|
console.log("created directory: " + d);
|
||
|
}
|
||
|
}
|
||
|
console.log("mounting /user_data");
|
||
|
mkdir_0("/user_data");
|
||
|
FS.mount(IDBFS, {}, "/user_data");
|
||
|
FS.syncfs(true, function(err) {
|
||
|
if (!err) {
|
||
|
console.log("codo: mounted filesystem.\n");
|
||
|
codo_mounted_filesystem = 1;
|
||
|
mkdir_0("/user_data/cdata");
|
||
|
mkdir_0("/user_data/cstore");
|
||
|
mkdir_0("/user_data/carts");
|
||
|
mkdir_0("/user_data/backup");
|
||
|
mkdir_0("/user_data/plates");
|
||
|
mkdir_0("/user_data/bbs");
|
||
|
mkdir_0("/user_data/bbs/carts");
|
||
|
mkdir_0("/user_data/bbs/labels");
|
||
|
} else {
|
||
|
console.log("** could not mount filesystem\n");
|
||
|
console.log(err);
|
||
|
}
|
||
|
});
|
||
|
}, function() {
|
||
|
var val = 0;
|
||
|
if (window.location.pathname.indexOf("widget.php") >= 0) val = 1;
|
||
|
return val;
|
||
|
}, function() {
|
||
|
var val = 0;
|
||
|
if (window.location.pathname.indexOf("pico-8.php") >= 0) val = 1;
|
||
|
return val;
|
||
|
}, function($0, $1, $2, $3, $4, $5) {
|
||
|
if (typeof pico8_state !== "undefined") {
|
||
|
pico8_state.is_paused = $0;
|
||
|
pico8_state.sound_volume = $1;
|
||
|
pico8_state.frame_number = $2;
|
||
|
pico8_state.has_focus = $3;
|
||
|
pico8_state.show_dpad = $4;
|
||
|
pico8_state.request_pointer_lock = $5;
|
||
|
}
|
||
|
}, function() {
|
||
|
var val = 0;
|
||
|
if (typeof codo_command !== "undefined") {
|
||
|
val = codo_command;
|
||
|
codo_command = 0;
|
||
|
}
|
||
|
return val;
|
||
|
}, function() {
|
||
|
var val = 0;
|
||
|
if (typeof codo_command_p !== "undefined") {
|
||
|
val = codo_command_p;
|
||
|
codo_command_p = 0;
|
||
|
}
|
||
|
return val;
|
||
|
}, function() {
|
||
|
button_i = 0;
|
||
|
}, function() {
|
||
|
var val = -1;
|
||
|
if (typeof pico8_buttons !== "undefined") {
|
||
|
val = pico8_buttons[button_i];
|
||
|
button_i++;
|
||
|
}
|
||
|
return val;
|
||
|
}, function() {
|
||
|
var val = 0;
|
||
|
if (typeof pico8_gamepads !== "undefined") {
|
||
|
val = pico8_gamepads.count;
|
||
|
}
|
||
|
return val;
|
||
|
}, function() {
|
||
|
if (typeof on_module_load !== "undefined") {
|
||
|
if (on_module_load) on_module_load();
|
||
|
}
|
||
|
}, function($0, $1, $2, $3, $4, $5) {
|
||
|
if (typeof p8img !== "undefined") {
|
||
|
p8img.src = "";
|
||
|
}
|
||
|
p8img = document.createElement("img");
|
||
|
p8img.src = UTF8ToString($0, $1);
|
||
|
p8img.style = "width:128px; height:128px; image-rendering: pixelated; -ms-interpolation-mode: nearest-neighbor;";
|
||
|
if (typeof p8imgholder === "undefined" || !p8imgholder) {
|
||
|
p8imgholder = document.createElement("div");
|
||
|
p8imgholder.style.cssText = "min-width:160px; display:table; position:fixed; top:20px; left:20px; padding:12px; background-color:#000; box-shadow: 2px 2px 8px rgba(16, 0, 48, 0.4);";
|
||
|
document.body.appendChild(p8imgholder);
|
||
|
}
|
||
|
if (p8imgholder) {
|
||
|
while (p8imgholder.childElementCount > 0) p8imgholder.removeChild(p8imgholder.firstChild);
|
||
|
var dismiss = document.createElement("div");
|
||
|
dismiss.style.cssText = "display:table; font-size:10pt; color:#fff; padding:4px; cursor:pointer; margin-left:10px; float:right";
|
||
|
dismiss.addEventListener("click", function() {
|
||
|
p8img.src = "";
|
||
|
while (p8imgholder.childElementCount > 0) p8imgholder.removeChild(p8imgholder.firstChild);
|
||
|
p8imgholder.style.display = "none";
|
||
|
}, false);
|
||
|
dismiss.innerHTML = "X";
|
||
|
p8imgholder.appendChild(dismiss);
|
||
|
p8imgholder.appendChild(p8img);
|
||
|
var info = document.createElement("div");
|
||
|
info.innerHTML = '<br> <font style="color:#bbb; font-size:8pt"><center> (right-click to save) </center></font>';
|
||
|
p8imgholder.appendChild(info);
|
||
|
if (p8imgholder.style.display == "none") p8imgholder.style.display = "";
|
||
|
}
|
||
|
}, function() {
|
||
|
jsString = p8_dropped_cart;
|
||
|
if (!jsString) return 0;
|
||
|
var lengthBytes = lengthBytesUTF8(jsString) + 1;
|
||
|
var stringOnWasmHeap = _malloc(lengthBytes);
|
||
|
stringToUTF8(jsString, stringOnWasmHeap, lengthBytes);
|
||
|
return stringOnWasmHeap;
|
||
|
}, function() {
|
||
|
jsString = p8_dropped_cart_name;
|
||
|
if (!jsString) return 0;
|
||
|
var lengthBytes = lengthBytesUTF8(jsString) + 1;
|
||
|
var stringOnWasmHeap2 = _malloc(lengthBytes);
|
||
|
stringToUTF8(jsString, stringOnWasmHeap2, lengthBytes);
|
||
|
return stringOnWasmHeap2;
|
||
|
}, function($0, $1) {
|
||
|
if (typeof pico8_state !== "undefined") {
|
||
|
if (typeof pico8_state.system_messages === "undefined") pico8_state.system_messages = new Array();
|
||
|
pico8_state.system_messages.push(UTF8ToString($0, $1));
|
||
|
}
|
||
|
}, function($0) {
|
||
|
var str = window.location.hostname;
|
||
|
return allocate(intArrayFromString(str), "i8", ALLOC_NORMAL);
|
||
|
}, function($0, $1) {
|
||
|
if (typeof pico8_gpio !== "undefined") pico8_gpio[$0] = $1;
|
||
|
}, function($0) {
|
||
|
var val = 0;
|
||
|
if (typeof pico8_gpio !== "undefined") val = pico8_gpio[$0];
|
||
|
return val;
|
||
|
}, function() {
|
||
|
FS.syncfs(false, function(err) {});
|
||
|
}, function() {
|
||
|
var val = 0;
|
||
|
if (typeof codo_mounted_filesystem !== "undefined") val = 1;
|
||
|
return val;
|
||
|
}, function() {
|
||
|
return typeof p8_touch_detected === "undefined" || !p8_touch_detected ? 0 : 1;
|
||
|
}, function() {
|
||
|
return document.hidden ? 1 : 0;
|
||
|
}, function() {
|
||
|
if (typeof codo_key_buffer === "undefined") codo_key_buffer = [];
|
||
|
document.addEventListener("keydown", function(e) {
|
||
|
var val = -1;
|
||
|
if (e.key.length == 1) {
|
||
|
val = e.key.charCodeAt(0);
|
||
|
} else {
|
||
|
if (e.key == "Tab") val = 9;
|
||
|
if (e.key == "Enter") val = 13;
|
||
|
if (e.key == "Backspace") val = 8;
|
||
|
if (e.key == "Escape") val = 27;
|
||
|
if (val == -1) {}
|
||
|
}
|
||
|
var el = document.getElementById("codo_textarea");
|
||
|
codo_key_buffer.push(val);
|
||
|
});
|
||
|
}, function() {
|
||
|
}, function() {
|
||
|
document.addEventListener("wheel", function(e) {
|
||
|
dx = e.deltaX;
|
||
|
if (dx < 0) dx = -1;
|
||
|
if (dx > 0) dx = 1;
|
||
|
if (e.deltaMode == 2) dx *= 4;
|
||
|
if (typeof codo_wheel_dx !== "undefined") codo_wheel_dx -= dx;
|
||
|
dy = e.deltaY;
|
||
|
if (dy < 0) dy = -1;
|
||
|
if (dy > 0) dy = 1;
|
||
|
if (e.deltaMode == 2) dy *= 4;
|
||
|
if (typeof codo_wheel_dy !== "undefined") codo_wheel_dy -= dy;
|
||
|
});
|
||
|
}, function($0) {
|
||
|
function audio_log(msg) {
|
||
|
if (window.console && window.console.log) {
|
||
|
window.console.log("[codo] audio_init_webaudio " + msg);
|
||
|
}
|
||
|
}
|
||
|
audio_log("audio_init");
|
||
|
var codo_audio_context;
|
||
|
if (typeof Module === "undefined") audio_log(" *** Module undefined"); else if (typeof Module.ccall === "undefined") audio_log(" **** Module.ccall undefined"); else {
|
||
|
var webAudioAPI = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext;
|
||
|
if (webAudioAPI) {
|
||
|
if (typeof pico8_audio_context !== "undefined") {
|
||
|
codo_audio_context = pico8_audio_context;
|
||
|
audio_log("found pico8_audio_context");
|
||
|
} else if (typeof voxatron_audio_context !== "undefined") {
|
||
|
codo_audio_context = voxatron_audio_context;
|
||
|
audio_log("found voxatron_audio_context");
|
||
|
} else {
|
||
|
codo_audio_context = new webAudioAPI();
|
||
|
audio_log("creating own audio context");
|
||
|
}
|
||
|
if (codo_audio_context) {
|
||
|
audio_log("Sample Rate: " + codo_audio_context.sampleRate);
|
||
|
audio_log("Buffer Size: " + $0);
|
||
|
node = codo_audio_context.createScriptProcessor($0, 1, 1);
|
||
|
node.onaudioprocess = function(e) {
|
||
|
var data = e.outputBuffer.getChannelData(0);
|
||
|
var r = 22050 / codo_audio_context.sampleRate;
|
||
|
var len0 = Math.floor(data.length * r);
|
||
|
var len1 = data.length;
|
||
|
var ptr = Module.ccall("mix_0", "number", [ "number", "number" ], [ len0, len1 ]);
|
||
|
for (var j = 0; j < data.length; j++) data[j] = Module.getValue(ptr + j * 2, "i16") / 32768;
|
||
|
};
|
||
|
node.connect(codo_audio_context.destination);
|
||
|
} else {
|
||
|
audio_log("** failed to create codo_audio_context");
|
||
|
}
|
||
|
} else {
|
||
|
audio_log("** webAudioAPI not found");
|
||
|
}
|
||
|
}
|
||
|
}, function() {
|
||
|
return document.pointerLockElement ? 1 : 0;
|
||
|
}, function() {
|
||
|
var ret = 0;
|
||
|
if (typeof pico8_mouse !== "undefined" && pico8_mouse.length > 0) ret = 1;
|
||
|
return ret;
|
||
|
}, function() {
|
||
|
return pico8_mouse[0];
|
||
|
}, function() {
|
||
|
return pico8_mouse[1];
|
||
|
}, function() {
|
||
|
if (typeof codo_key_buffer === "undefined") codo_key_buffer = [];
|
||
|
return codo_key_buffer.length > 0 ? 1 : 0;
|
||
|
}, function() {
|
||
|
if (typeof codo_key_buffer === "undefined") codo_key_buffer = [];
|
||
|
let val = codo_key_buffer.shift() | 0;
|
||
|
return val;
|
||
|
}, function() {
|
||
|
temp = typeof codo_wheel_dx !== "undefined" ? codo_wheel_dx : 0;
|
||
|
codo_wheel_dx = 0;
|
||
|
return temp;
|
||
|
}, function() {
|
||
|
temp = typeof codo_wheel_dy !== "undefined" ? codo_wheel_dy : 0;
|
||
|
codo_wheel_dy = 0;
|
||
|
return temp;
|
||
|
}, function() {
|
||
|
if (document.hidden) return 0;
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el) {
|
||
|
if (el == document.activeElement) return 1;
|
||
|
}
|
||
|
el = document.activeElement;
|
||
|
return !el || el.tagName.toLowerCase() != "input" && el.tagName.toLowerCase() != "textarea";
|
||
|
}, function() {
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el && el.style.display != "none") {
|
||
|
el.focus();
|
||
|
el.select();
|
||
|
}
|
||
|
}, function() {
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el && el.style.display != "none") {
|
||
|
el.select();
|
||
|
}
|
||
|
}, function() {
|
||
|
return pico8_mouse[2];
|
||
|
}, function() {
|
||
|
_dir_name = "";
|
||
|
}, function($0) {
|
||
|
_dir_name = _dir_name + String.fromCharCode($0);
|
||
|
}, function() {
|
||
|
console.log("@@ mkdir directory (nocheck): " + _dir_name);
|
||
|
FS.createPath("", _dir_name, true, true);
|
||
|
}, function() {
|
||
|
Module["canvas"].exitPointerLock();
|
||
|
}, function() {
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el) {}
|
||
|
}, function() {
|
||
|
_codo_str_out = "";
|
||
|
}, function($0) {
|
||
|
_codo_str_out = _codo_str_out + String.fromCharCode($0);
|
||
|
}, function() {
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el) {
|
||
|
el.value = _codo_str_out;
|
||
|
return 0;
|
||
|
} else return 1;
|
||
|
}, function() {
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el && el.style.display == "none" && (typeof p8_touch_detected === "undefined" || !p8_touch_detected)) {
|
||
|
console.log("@@ enabling codo_textfield");
|
||
|
el.style.display = "";
|
||
|
el.focus();
|
||
|
el.select();
|
||
|
}
|
||
|
}, function() {
|
||
|
el = typeof codo_textarea === "undefined" ? document.getElementById("codo_textarea") : codo_textarea;
|
||
|
if (el && el.style.display != "none" && el.value != "") {
|
||
|
_codo_text_value = el.value;
|
||
|
return 1;
|
||
|
}
|
||
|
return 0;
|
||
|
}, function() {
|
||
|
return typeof _codo_text_value === "undefined" ? 1 : 0;
|
||
|
}, function() {
|
||
|
iii = 0;
|
||
|
}, function() {
|
||
|
iii = iii + 1;
|
||
|
return _codo_text_value.charCodeAt(iii - 1);
|
||
|
} ];
|
||
|
|
||
|
function _emscripten_asm_const_i(code) {
|
||
|
return ASM_CONSTS[code]();
|
||
|
}
|
||
|
|
||
|
function _emscripten_asm_const_ii(code, a0) {
|
||
|
return ASM_CONSTS[code](a0);
|
||
|
}
|
||
|
|
||
|
function _emscripten_asm_const_iiiiiii(code, a0, a1, a2, a3, a4, a5) {
|
||
|
return ASM_CONSTS[code](a0, a1, a2, a3, a4, a5);
|
||
|
}
|
||
|
|
||
|
function _emscripten_asm_const_iii(code, a0, a1) {
|
||
|
return ASM_CONSTS[code](a0, a1);
|
||
|
}
|
||
|
|
||
|
__ATINIT__.push({
|
||
|
func: function() {
|
||
|
___emscripten_environ_constructor();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
memoryInitializer = "data:application/octet-stream;base64,AAAAAAAAAACFsQAAxd0AAI6xAACWsQAAn7EAAKaxAACtsQAAZ90AAJaxAACzsQAAurEAAMCxAAAAAAAAAAAAAAAACAgICAgAAAAAAAAAAAAAAAAAAAAAAAAMBAQEBAQEBAQEBAQEBAQEFhYWFhYWFhYWFgQEBAQEBAQVFRUVFRUFBQUFBQUFBQUFBQUFBQUFBQUFBQQEBAQFBBUVFRUVFQUFBQUFBQUFBQUFBQUFBQUFBQUFBAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAAQKCgAAAAofCh8KHxQfBR8RAgQIEQgUHRINBAQAAAAECAgIBAQCAgIEFQ4fDhUEBB8EBAAAAAgQAAAfAAAAAAAABAECBAgQHxERER8EDAQEHx8BHxAfHwEHAR8RER8BAR8QHwEfEBAfER8fAQEBAR8RHxEfHxEfAQEABAAEAAAEAAQIAwwQDAMADgAOABgGAQYYH
|
||
|
|
||
|
var tempDoublePtr = 3042720;
|
||
|
|
||
|
function ___setErrNo(value) {
|
||
|
if (Module["___errno_location"]) HEAP32[Module["___errno_location"]() >> 2] = value;
|
||
|
return value;
|
||
|
}
|
||
|
|
||
|
var PATH = {
|
||
|
splitPath: function(filename) {
|
||
|
var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
|
||
|
return splitPathRe.exec(filename).slice(1);
|
||
|
},
|
||
|
normalizeArray: function(parts, allowAboveRoot) {
|
||
|
var up = 0;
|
||
|
for (var i = parts.length - 1; i >= 0; i--) {
|
||
|
var last = parts[i];
|
||
|
if (last === ".") {
|
||
|
parts.splice(i, 1);
|
||
|
} else if (last === "..") {
|
||
|
parts.splice(i, 1);
|
||
|
up++;
|
||
|
} else if (up) {
|
||
|
parts.splice(i, 1);
|
||
|
up--;
|
||
|
}
|
||
|
}
|
||
|
if (allowAboveRoot) {
|
||
|
for (;up; up--) {
|
||
|
parts.unshift("..");
|
||
|
}
|
||
|
}
|
||
|
return parts;
|
||
|
},
|
||
|
normalize: function(path) {
|
||
|
var isAbsolute = path.charAt(0) === "/", trailingSlash = path.substr(-1) === "/";
|
||
|
path = PATH.normalizeArray(path.split("/").filter(function(p) {
|
||
|
return !!p;
|
||
|
}), !isAbsolute).join("/");
|
||
|
if (!path && !isAbsolute) {
|
||
|
path = ".";
|
||
|
}
|
||
|
if (path && trailingSlash) {
|
||
|
path += "/";
|
||
|
}
|
||
|
return (isAbsolute ? "/" : "") + path;
|
||
|
},
|
||
|
dirname: function(path) {
|
||
|
var result = PATH.splitPath(path), root = result[0], dir = result[1];
|
||
|
if (!root && !dir) {
|
||
|
return ".";
|
||
|
}
|
||
|
if (dir) {
|
||
|
dir = dir.substr(0, dir.length - 1);
|
||
|
}
|
||
|
return root + dir;
|
||
|
},
|
||
|
basename: function(path) {
|
||
|
if (path === "/") return "/";
|
||
|
var lastSlash = path.lastIndexOf("/");
|
||
|
if (lastSlash === -1) return path;
|
||
|
return path.substr(lastSlash + 1);
|
||
|
},
|
||
|
extname: function(path) {
|
||
|
return PATH.splitPath(path)[3];
|
||
|
},
|
||
|
join: function() {
|
||
|
var paths = Array.prototype.slice.call(arguments, 0);
|
||
|
return PATH.normalize(paths.join("/"));
|
||
|
},
|
||
|
join2: function(l, r) {
|
||
|
return PATH.normalize(l + "/" + r);
|
||
|
},
|
||
|
resolve: function() {
|
||
|
var resolvedPath = "", resolvedAbsolute = false;
|
||
|
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||
|
var path = i >= 0 ? arguments[i] : FS.cwd();
|
||
|
if (typeof path !== "string") {
|
||
|
throw new TypeError("Arguments to path.resolve must be strings");
|
||
|
} else if (!path) {
|
||
|
return "";
|
||
|
}
|
||
|
resolvedPath = path + "/" + resolvedPath;
|
||
|
resolvedAbsolute = path.charAt(0) === "/";
|
||
|
}
|
||
|
resolvedPath = PATH.normalizeArray(resolvedPath.split("/").filter(function(p) {
|
||
|
return !!p;
|
||
|
}), !resolvedAbsolute).join("/");
|
||
|
return (resolvedAbsolute ? "/" : "") + resolvedPath || ".";
|
||
|
},
|
||
|
relative: function(from, to) {
|
||
|
from = PATH.resolve(from).substr(1);
|
||
|
to = PATH.resolve(to).substr(1);
|
||
|
function trim(arr) {
|
||
|
var start = 0;
|
||
|
for (;start < arr.length; start++) {
|
||
|
if (arr[start] !== "") break;
|
||
|
}
|
||
|
var end = arr.length - 1;
|
||
|
for (;end >= 0; end--) {
|
||
|
if (arr[end] !== "") break;
|
||
|
}
|
||
|
if (start > end) return [];
|
||
|
return arr.slice(start, end - start + 1);
|
||
|
}
|
||
|
var fromParts = trim(from.split("/"));
|
||
|
var toParts = trim(to.split("/"));
|
||
|
var length = Math.min(fromParts.length, toParts.length);
|
||
|
var samePartsLength = length;
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
if (fromParts[i] !== toParts[i]) {
|
||
|
samePartsLength = i;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
var outputParts = [];
|
||
|
for (var i = samePartsLength; i < fromParts.length; i++) {
|
||
|
outputParts.push("..");
|
||
|
}
|
||
|
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
||
|
return outputParts.join("/");
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var TTY = {
|
||
|
ttys: [],
|
||
|
init: function() {},
|
||
|
shutdown: function() {},
|
||
|
register: function(dev, ops) {
|
||
|
TTY.ttys[dev] = {
|
||
|
input: [],
|
||
|
output: [],
|
||
|
ops: ops
|
||
|
};
|
||
|
FS.registerDevice(dev, TTY.stream_ops);
|
||
|
},
|
||
|
stream_ops: {
|
||
|
open: function(stream) {
|
||
|
var tty = TTY.ttys[stream.node.rdev];
|
||
|
if (!tty) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
stream.tty = tty;
|
||
|
stream.seekable = false;
|
||
|
},
|
||
|
close: function(stream) {
|
||
|
stream.tty.ops.flush(stream.tty);
|
||
|
},
|
||
|
flush: function(stream) {
|
||
|
stream.tty.ops.flush(stream.tty);
|
||
|
},
|
||
|
read: function(stream, buffer, offset, length, pos) {
|
||
|
if (!stream.tty || !stream.tty.ops.get_char) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
|
||
|
}
|
||
|
var bytesRead = 0;
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
var result;
|
||
|
try {
|
||
|
result = stream.tty.ops.get_char(stream.tty);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
if (result === undefined && bytesRead === 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
|
||
|
}
|
||
|
if (result === null || result === undefined) break;
|
||
|
bytesRead++;
|
||
|
buffer[offset + i] = result;
|
||
|
}
|
||
|
if (bytesRead) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return bytesRead;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, pos) {
|
||
|
if (!stream.tty || !stream.tty.ops.put_char) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
|
||
|
}
|
||
|
try {
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
stream.tty.ops.put_char(stream.tty, buffer[offset + i]);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
}
|
||
|
if (length) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
},
|
||
|
default_tty_ops: {
|
||
|
get_char: function(tty) {
|
||
|
if (!tty.input.length) {
|
||
|
var result = null;
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
var BUFSIZE = 256;
|
||
|
var buf = new Buffer(BUFSIZE);
|
||
|
var bytesRead = 0;
|
||
|
var isPosixPlatform = process.platform != "win32";
|
||
|
var fd = process.stdin.fd;
|
||
|
if (isPosixPlatform) {
|
||
|
var usingDevice = false;
|
||
|
try {
|
||
|
fd = fs.openSync("/dev/stdin", "r");
|
||
|
usingDevice = true;
|
||
|
} catch (e) {}
|
||
|
}
|
||
|
try {
|
||
|
bytesRead = fs.readSync(fd, buf, 0, BUFSIZE, null);
|
||
|
} catch (e) {
|
||
|
if (e.toString().indexOf("EOF") != -1) bytesRead = 0; else throw e;
|
||
|
}
|
||
|
if (usingDevice) {
|
||
|
fs.closeSync(fd);
|
||
|
}
|
||
|
if (bytesRead > 0) {
|
||
|
result = buf.slice(0, bytesRead).toString("utf-8");
|
||
|
} else {
|
||
|
result = null;
|
||
|
}
|
||
|
} else if (typeof window != "undefined" && typeof window.prompt == "function") {
|
||
|
result = window.prompt("Input: ");
|
||
|
if (result !== null) {
|
||
|
result += "\n";
|
||
|
}
|
||
|
} else if (typeof readline == "function") {
|
||
|
result = readline();
|
||
|
if (result !== null) {
|
||
|
result += "\n";
|
||
|
}
|
||
|
}
|
||
|
if (!result) {
|
||
|
return null;
|
||
|
}
|
||
|
tty.input = intArrayFromString(result, true);
|
||
|
}
|
||
|
return tty.input.shift();
|
||
|
},
|
||
|
put_char: function(tty, val) {
|
||
|
if (val === null || val === 10) {
|
||
|
out(UTF8ArrayToString(tty.output, 0));
|
||
|
tty.output = [];
|
||
|
} else {
|
||
|
if (val != 0) tty.output.push(val);
|
||
|
}
|
||
|
},
|
||
|
flush: function(tty) {
|
||
|
if (tty.output && tty.output.length > 0) {
|
||
|
out(UTF8ArrayToString(tty.output, 0));
|
||
|
tty.output = [];
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
default_tty1_ops: {
|
||
|
put_char: function(tty, val) {
|
||
|
if (val === null || val === 10) {
|
||
|
err(UTF8ArrayToString(tty.output, 0));
|
||
|
tty.output = [];
|
||
|
} else {
|
||
|
if (val != 0) tty.output.push(val);
|
||
|
}
|
||
|
},
|
||
|
flush: function(tty) {
|
||
|
if (tty.output && tty.output.length > 0) {
|
||
|
err(UTF8ArrayToString(tty.output, 0));
|
||
|
tty.output = [];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var MEMFS = {
|
||
|
ops_table: null,
|
||
|
mount: function(mount) {
|
||
|
return MEMFS.createNode(null, "/", 16384 | 511, 0);
|
||
|
},
|
||
|
createNode: function(parent, name, mode, dev) {
|
||
|
if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
if (!MEMFS.ops_table) {
|
||
|
MEMFS.ops_table = {
|
||
|
dir: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr,
|
||
|
lookup: MEMFS.node_ops.lookup,
|
||
|
mknod: MEMFS.node_ops.mknod,
|
||
|
rename: MEMFS.node_ops.rename,
|
||
|
unlink: MEMFS.node_ops.unlink,
|
||
|
rmdir: MEMFS.node_ops.rmdir,
|
||
|
readdir: MEMFS.node_ops.readdir,
|
||
|
symlink: MEMFS.node_ops.symlink
|
||
|
},
|
||
|
stream: {
|
||
|
llseek: MEMFS.stream_ops.llseek
|
||
|
}
|
||
|
},
|
||
|
file: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr
|
||
|
},
|
||
|
stream: {
|
||
|
llseek: MEMFS.stream_ops.llseek,
|
||
|
read: MEMFS.stream_ops.read,
|
||
|
write: MEMFS.stream_ops.write,
|
||
|
allocate: MEMFS.stream_ops.allocate,
|
||
|
mmap: MEMFS.stream_ops.mmap,
|
||
|
msync: MEMFS.stream_ops.msync
|
||
|
}
|
||
|
},
|
||
|
link: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr,
|
||
|
readlink: MEMFS.node_ops.readlink
|
||
|
},
|
||
|
stream: {}
|
||
|
},
|
||
|
chrdev: {
|
||
|
node: {
|
||
|
getattr: MEMFS.node_ops.getattr,
|
||
|
setattr: MEMFS.node_ops.setattr
|
||
|
},
|
||
|
stream: FS.chrdev_stream_ops
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
var node = FS.createNode(parent, name, mode, dev);
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.dir.node;
|
||
|
node.stream_ops = MEMFS.ops_table.dir.stream;
|
||
|
node.contents = {};
|
||
|
} else if (FS.isFile(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.file.node;
|
||
|
node.stream_ops = MEMFS.ops_table.file.stream;
|
||
|
node.usedBytes = 0;
|
||
|
node.contents = null;
|
||
|
} else if (FS.isLink(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.link.node;
|
||
|
node.stream_ops = MEMFS.ops_table.link.stream;
|
||
|
} else if (FS.isChrdev(node.mode)) {
|
||
|
node.node_ops = MEMFS.ops_table.chrdev.node;
|
||
|
node.stream_ops = MEMFS.ops_table.chrdev.stream;
|
||
|
}
|
||
|
node.timestamp = Date.now();
|
||
|
if (parent) {
|
||
|
parent.contents[name] = node;
|
||
|
}
|
||
|
return node;
|
||
|
},
|
||
|
getFileDataAsRegularArray: function(node) {
|
||
|
if (node.contents && node.contents.subarray) {
|
||
|
var arr = [];
|
||
|
for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]);
|
||
|
return arr;
|
||
|
}
|
||
|
return node.contents;
|
||
|
},
|
||
|
getFileDataAsTypedArray: function(node) {
|
||
|
if (!node.contents) return new Uint8Array();
|
||
|
if (node.contents.subarray) return node.contents.subarray(0, node.usedBytes);
|
||
|
return new Uint8Array(node.contents);
|
||
|
},
|
||
|
expandFileStorage: function(node, newCapacity) {
|
||
|
var prevCapacity = node.contents ? node.contents.length : 0;
|
||
|
if (prevCapacity >= newCapacity) return;
|
||
|
var CAPACITY_DOUBLING_MAX = 1024 * 1024;
|
||
|
newCapacity = Math.max(newCapacity, prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125) | 0);
|
||
|
if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256);
|
||
|
var oldContents = node.contents;
|
||
|
node.contents = new Uint8Array(newCapacity);
|
||
|
if (node.usedBytes > 0) node.contents.set(oldContents.subarray(0, node.usedBytes), 0);
|
||
|
return;
|
||
|
},
|
||
|
resizeFileStorage: function(node, newSize) {
|
||
|
if (node.usedBytes == newSize) return;
|
||
|
if (newSize == 0) {
|
||
|
node.contents = null;
|
||
|
node.usedBytes = 0;
|
||
|
return;
|
||
|
}
|
||
|
if (!node.contents || node.contents.subarray) {
|
||
|
var oldContents = node.contents;
|
||
|
node.contents = new Uint8Array(new ArrayBuffer(newSize));
|
||
|
if (oldContents) {
|
||
|
node.contents.set(oldContents.subarray(0, Math.min(newSize, node.usedBytes)));
|
||
|
}
|
||
|
node.usedBytes = newSize;
|
||
|
return;
|
||
|
}
|
||
|
if (!node.contents) node.contents = [];
|
||
|
if (node.contents.length > newSize) node.contents.length = newSize; else while (node.contents.length < newSize) node.contents.push(0);
|
||
|
node.usedBytes = newSize;
|
||
|
},
|
||
|
node_ops: {
|
||
|
getattr: function(node) {
|
||
|
var attr = {};
|
||
|
attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
|
||
|
attr.ino = node.id;
|
||
|
attr.mode = node.mode;
|
||
|
attr.nlink = 1;
|
||
|
attr.uid = 0;
|
||
|
attr.gid = 0;
|
||
|
attr.rdev = node.rdev;
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
attr.size = 4096;
|
||
|
} else if (FS.isFile(node.mode)) {
|
||
|
attr.size = node.usedBytes;
|
||
|
} else if (FS.isLink(node.mode)) {
|
||
|
attr.size = node.link.length;
|
||
|
} else {
|
||
|
attr.size = 0;
|
||
|
}
|
||
|
attr.atime = new Date(node.timestamp);
|
||
|
attr.mtime = new Date(node.timestamp);
|
||
|
attr.ctime = new Date(node.timestamp);
|
||
|
attr.blksize = 4096;
|
||
|
attr.blocks = Math.ceil(attr.size / attr.blksize);
|
||
|
return attr;
|
||
|
},
|
||
|
setattr: function(node, attr) {
|
||
|
if (attr.mode !== undefined) {
|
||
|
node.mode = attr.mode;
|
||
|
}
|
||
|
if (attr.timestamp !== undefined) {
|
||
|
node.timestamp = attr.timestamp;
|
||
|
}
|
||
|
if (attr.size !== undefined) {
|
||
|
MEMFS.resizeFileStorage(node, attr.size);
|
||
|
}
|
||
|
},
|
||
|
lookup: function(parent, name) {
|
||
|
throw FS.genericErrors[ERRNO_CODES.ENOENT];
|
||
|
},
|
||
|
mknod: function(parent, name, mode, dev) {
|
||
|
return MEMFS.createNode(parent, name, mode, dev);
|
||
|
},
|
||
|
rename: function(old_node, new_dir, new_name) {
|
||
|
if (FS.isDir(old_node.mode)) {
|
||
|
var new_node;
|
||
|
try {
|
||
|
new_node = FS.lookupNode(new_dir, new_name);
|
||
|
} catch (e) {}
|
||
|
if (new_node) {
|
||
|
for (var i in new_node.contents) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
delete old_node.parent.contents[old_node.name];
|
||
|
old_node.name = new_name;
|
||
|
new_dir.contents[new_name] = old_node;
|
||
|
old_node.parent = new_dir;
|
||
|
},
|
||
|
unlink: function(parent, name) {
|
||
|
delete parent.contents[name];
|
||
|
},
|
||
|
rmdir: function(parent, name) {
|
||
|
var node = FS.lookupNode(parent, name);
|
||
|
for (var i in node.contents) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
|
||
|
}
|
||
|
delete parent.contents[name];
|
||
|
},
|
||
|
readdir: function(node) {
|
||
|
var entries = [ ".", ".." ];
|
||
|
for (var key in node.contents) {
|
||
|
if (!node.contents.hasOwnProperty(key)) {
|
||
|
continue;
|
||
|
}
|
||
|
entries.push(key);
|
||
|
}
|
||
|
return entries;
|
||
|
},
|
||
|
symlink: function(parent, newname, oldpath) {
|
||
|
var node = MEMFS.createNode(parent, newname, 511 | 40960, 0);
|
||
|
node.link = oldpath;
|
||
|
return node;
|
||
|
},
|
||
|
readlink: function(node) {
|
||
|
if (!FS.isLink(node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
return node.link;
|
||
|
}
|
||
|
},
|
||
|
stream_ops: {
|
||
|
read: function(stream, buffer, offset, length, position) {
|
||
|
var contents = stream.node.contents;
|
||
|
if (position >= stream.node.usedBytes) return 0;
|
||
|
var size = Math.min(stream.node.usedBytes - position, length);
|
||
|
assert(size >= 0);
|
||
|
if (size > 8 && contents.subarray) {
|
||
|
buffer.set(contents.subarray(position, position + size), offset);
|
||
|
} else {
|
||
|
for (var i = 0; i < size; i++) buffer[offset + i] = contents[position + i];
|
||
|
}
|
||
|
return size;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, position, canOwn) {
|
||
|
if (!length) return 0;
|
||
|
var node = stream.node;
|
||
|
node.timestamp = Date.now();
|
||
|
if (buffer.subarray && (!node.contents || node.contents.subarray)) {
|
||
|
if (canOwn) {
|
||
|
node.contents = buffer.subarray(offset, offset + length);
|
||
|
node.usedBytes = length;
|
||
|
return length;
|
||
|
} else if (node.usedBytes === 0 && position === 0) {
|
||
|
node.contents = new Uint8Array(buffer.subarray(offset, offset + length));
|
||
|
node.usedBytes = length;
|
||
|
return length;
|
||
|
} else if (position + length <= node.usedBytes) {
|
||
|
node.contents.set(buffer.subarray(offset, offset + length), position);
|
||
|
return length;
|
||
|
}
|
||
|
}
|
||
|
MEMFS.expandFileStorage(node, position + length);
|
||
|
if (node.contents.subarray && buffer.subarray) node.contents.set(buffer.subarray(offset, offset + length), position); else {
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
node.contents[position + i] = buffer[offset + i];
|
||
|
}
|
||
|
}
|
||
|
node.usedBytes = Math.max(node.usedBytes, position + length);
|
||
|
return length;
|
||
|
},
|
||
|
llseek: function(stream, offset, whence) {
|
||
|
var position = offset;
|
||
|
if (whence === 1) {
|
||
|
position += stream.position;
|
||
|
} else if (whence === 2) {
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
position += stream.node.usedBytes;
|
||
|
}
|
||
|
}
|
||
|
if (position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
return position;
|
||
|
},
|
||
|
allocate: function(stream, offset, length) {
|
||
|
MEMFS.expandFileStorage(stream.node, offset + length);
|
||
|
stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length);
|
||
|
},
|
||
|
mmap: function(stream, buffer, offset, length, position, prot, flags) {
|
||
|
if (!FS.isFile(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
var ptr;
|
||
|
var allocated;
|
||
|
var contents = stream.node.contents;
|
||
|
if (!(flags & 2) && (contents.buffer === buffer || contents.buffer === buffer.buffer)) {
|
||
|
allocated = false;
|
||
|
ptr = contents.byteOffset;
|
||
|
} else {
|
||
|
if (position > 0 || position + length < stream.node.usedBytes) {
|
||
|
if (contents.subarray) {
|
||
|
contents = contents.subarray(position, position + length);
|
||
|
} else {
|
||
|
contents = Array.prototype.slice.call(contents, position, position + length);
|
||
|
}
|
||
|
}
|
||
|
allocated = true;
|
||
|
ptr = _malloc(length);
|
||
|
if (!ptr) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
|
||
|
}
|
||
|
buffer.set(contents, ptr);
|
||
|
}
|
||
|
return {
|
||
|
ptr: ptr,
|
||
|
allocated: allocated
|
||
|
};
|
||
|
},
|
||
|
msync: function(stream, buffer, offset, length, mmapFlags) {
|
||
|
if (!FS.isFile(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
|
||
|
}
|
||
|
if (mmapFlags & 2) {
|
||
|
return 0;
|
||
|
}
|
||
|
var bytesWritten = MEMFS.stream_ops.write(stream, buffer, 0, length, offset, false);
|
||
|
return 0;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var IDBFS = {
|
||
|
dbs: {},
|
||
|
indexedDB: function() {
|
||
|
if (typeof indexedDB !== "undefined") return indexedDB;
|
||
|
var ret = null;
|
||
|
if (typeof window === "object") ret = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
||
|
assert(ret, "IDBFS used, but indexedDB not supported");
|
||
|
return ret;
|
||
|
},
|
||
|
DB_VERSION: 21,
|
||
|
DB_STORE_NAME: "FILE_DATA",
|
||
|
mount: function(mount) {
|
||
|
return MEMFS.mount.apply(null, arguments);
|
||
|
},
|
||
|
syncfs: function(mount, populate, callback) {
|
||
|
IDBFS.getLocalSet(mount, function(err, local) {
|
||
|
if (err) return callback(err);
|
||
|
IDBFS.getRemoteSet(mount, function(err, remote) {
|
||
|
if (err) return callback(err);
|
||
|
var src = populate ? remote : local;
|
||
|
var dst = populate ? local : remote;
|
||
|
IDBFS.reconcile(src, dst, callback);
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
getDB: function(name, callback) {
|
||
|
var db = IDBFS.dbs[name];
|
||
|
if (db) {
|
||
|
return callback(null, db);
|
||
|
}
|
||
|
var req;
|
||
|
try {
|
||
|
req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
if (!req) {
|
||
|
return callback("Unable to connect to IndexedDB");
|
||
|
}
|
||
|
req.onupgradeneeded = function(e) {
|
||
|
var db = e.target.result;
|
||
|
var transaction = e.target.transaction;
|
||
|
var fileStore;
|
||
|
if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {
|
||
|
fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);
|
||
|
} else {
|
||
|
fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);
|
||
|
}
|
||
|
if (!fileStore.indexNames.contains("timestamp")) {
|
||
|
fileStore.createIndex("timestamp", "timestamp", {
|
||
|
unique: false
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
req.onsuccess = function() {
|
||
|
db = req.result;
|
||
|
IDBFS.dbs[name] = db;
|
||
|
callback(null, db);
|
||
|
};
|
||
|
req.onerror = function(e) {
|
||
|
callback(this.error);
|
||
|
e.preventDefault();
|
||
|
};
|
||
|
},
|
||
|
getLocalSet: function(mount, callback) {
|
||
|
var entries = {};
|
||
|
function isRealDir(p) {
|
||
|
return p !== "." && p !== "..";
|
||
|
}
|
||
|
function toAbsolute(root) {
|
||
|
return function(p) {
|
||
|
return PATH.join2(root, p);
|
||
|
};
|
||
|
}
|
||
|
var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
|
||
|
while (check.length) {
|
||
|
var path = check.pop();
|
||
|
var stat;
|
||
|
try {
|
||
|
stat = FS.stat(path);
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
if (FS.isDir(stat.mode)) {
|
||
|
check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
|
||
|
}
|
||
|
entries[path] = {
|
||
|
timestamp: stat.mtime
|
||
|
};
|
||
|
}
|
||
|
return callback(null, {
|
||
|
type: "local",
|
||
|
entries: entries
|
||
|
});
|
||
|
},
|
||
|
getRemoteSet: function(mount, callback) {
|
||
|
var entries = {};
|
||
|
IDBFS.getDB(mount.mountpoint, function(err, db) {
|
||
|
if (err) return callback(err);
|
||
|
try {
|
||
|
var transaction = db.transaction([ IDBFS.DB_STORE_NAME ], "readonly");
|
||
|
transaction.onerror = function(e) {
|
||
|
callback(this.error);
|
||
|
e.preventDefault();
|
||
|
};
|
||
|
var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
|
||
|
var index = store.index("timestamp");
|
||
|
index.openKeyCursor().onsuccess = function(event) {
|
||
|
var cursor = event.target.result;
|
||
|
if (!cursor) {
|
||
|
return callback(null, {
|
||
|
type: "remote",
|
||
|
db: db,
|
||
|
entries: entries
|
||
|
});
|
||
|
}
|
||
|
entries[cursor.primaryKey] = {
|
||
|
timestamp: cursor.key
|
||
|
};
|
||
|
cursor.continue();
|
||
|
};
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
loadLocalEntry: function(path, callback) {
|
||
|
var stat, node;
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path);
|
||
|
node = lookup.node;
|
||
|
stat = FS.stat(path);
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
if (FS.isDir(stat.mode)) {
|
||
|
return callback(null, {
|
||
|
timestamp: stat.mtime,
|
||
|
mode: stat.mode
|
||
|
});
|
||
|
} else if (FS.isFile(stat.mode)) {
|
||
|
node.contents = MEMFS.getFileDataAsTypedArray(node);
|
||
|
return callback(null, {
|
||
|
timestamp: stat.mtime,
|
||
|
mode: stat.mode,
|
||
|
contents: node.contents
|
||
|
});
|
||
|
} else {
|
||
|
return callback(new Error("node type not supported"));
|
||
|
}
|
||
|
},
|
||
|
storeLocalEntry: function(path, entry, callback) {
|
||
|
try {
|
||
|
if (FS.isDir(entry.mode)) {
|
||
|
FS.mkdir(path, entry.mode);
|
||
|
} else if (FS.isFile(entry.mode)) {
|
||
|
FS.writeFile(path, entry.contents, {
|
||
|
canOwn: true
|
||
|
});
|
||
|
} else {
|
||
|
return callback(new Error("node type not supported"));
|
||
|
}
|
||
|
FS.chmod(path, entry.mode);
|
||
|
FS.utime(path, entry.timestamp, entry.timestamp);
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
callback(null);
|
||
|
},
|
||
|
removeLocalEntry: function(path, callback) {
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path);
|
||
|
var stat = FS.stat(path);
|
||
|
if (FS.isDir(stat.mode)) {
|
||
|
FS.rmdir(path);
|
||
|
} else if (FS.isFile(stat.mode)) {
|
||
|
FS.unlink(path);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
return callback(e);
|
||
|
}
|
||
|
callback(null);
|
||
|
},
|
||
|
loadRemoteEntry: function(store, path, callback) {
|
||
|
var req = store.get(path);
|
||
|
req.onsuccess = function(event) {
|
||
|
callback(null, event.target.result);
|
||
|
};
|
||
|
req.onerror = function(e) {
|
||
|
callback(this.error);
|
||
|
e.preventDefault();
|
||
|
};
|
||
|
},
|
||
|
storeRemoteEntry: function(store, path, entry, callback) {
|
||
|
var req = store.put(entry, path);
|
||
|
req.onsuccess = function() {
|
||
|
callback(null);
|
||
|
};
|
||
|
req.onerror = function(e) {
|
||
|
callback(this.error);
|
||
|
e.preventDefault();
|
||
|
};
|
||
|
},
|
||
|
removeRemoteEntry: function(store, path, callback) {
|
||
|
var req = store.delete(path);
|
||
|
req.onsuccess = function() {
|
||
|
callback(null);
|
||
|
};
|
||
|
req.onerror = function(e) {
|
||
|
callback(this.error);
|
||
|
e.preventDefault();
|
||
|
};
|
||
|
},
|
||
|
reconcile: function(src, dst, callback) {
|
||
|
var total = 0;
|
||
|
var create = [];
|
||
|
Object.keys(src.entries).forEach(function(key) {
|
||
|
var e = src.entries[key];
|
||
|
var e2 = dst.entries[key];
|
||
|
if (!e2 || e.timestamp > e2.timestamp) {
|
||
|
create.push(key);
|
||
|
total++;
|
||
|
}
|
||
|
});
|
||
|
var remove = [];
|
||
|
Object.keys(dst.entries).forEach(function(key) {
|
||
|
var e = dst.entries[key];
|
||
|
var e2 = src.entries[key];
|
||
|
if (!e2) {
|
||
|
remove.push(key);
|
||
|
total++;
|
||
|
}
|
||
|
});
|
||
|
if (!total) {
|
||
|
return callback(null);
|
||
|
}
|
||
|
var errored = false;
|
||
|
var completed = 0;
|
||
|
var db = src.type === "remote" ? src.db : dst.db;
|
||
|
var transaction = db.transaction([ IDBFS.DB_STORE_NAME ], "readwrite");
|
||
|
var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
|
||
|
function done(err) {
|
||
|
if (err) {
|
||
|
if (!done.errored) {
|
||
|
done.errored = true;
|
||
|
return callback(err);
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
if (++completed >= total) {
|
||
|
return callback(null);
|
||
|
}
|
||
|
}
|
||
|
transaction.onerror = function(e) {
|
||
|
done(this.error);
|
||
|
e.preventDefault();
|
||
|
};
|
||
|
create.sort().forEach(function(path) {
|
||
|
if (dst.type === "local") {
|
||
|
IDBFS.loadRemoteEntry(store, path, function(err, entry) {
|
||
|
if (err) return done(err);
|
||
|
IDBFS.storeLocalEntry(path, entry, done);
|
||
|
});
|
||
|
} else {
|
||
|
IDBFS.loadLocalEntry(path, function(err, entry) {
|
||
|
if (err) return done(err);
|
||
|
IDBFS.storeRemoteEntry(store, path, entry, done);
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
remove.sort().reverse().forEach(function(path) {
|
||
|
if (dst.type === "local") {
|
||
|
IDBFS.removeLocalEntry(path, done);
|
||
|
} else {
|
||
|
IDBFS.removeRemoteEntry(store, path, done);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var NODEFS = {
|
||
|
isWindows: false,
|
||
|
staticInit: function() {
|
||
|
NODEFS.isWindows = !!process.platform.match(/^win/);
|
||
|
var flags = process["binding"]("constants");
|
||
|
if (flags["fs"]) {
|
||
|
flags = flags["fs"];
|
||
|
}
|
||
|
NODEFS.flagsForNodeMap = {
|
||
|
1024: flags["O_APPEND"],
|
||
|
64: flags["O_CREAT"],
|
||
|
128: flags["O_EXCL"],
|
||
|
0: flags["O_RDONLY"],
|
||
|
2: flags["O_RDWR"],
|
||
|
4096: flags["O_SYNC"],
|
||
|
512: flags["O_TRUNC"],
|
||
|
1: flags["O_WRONLY"]
|
||
|
};
|
||
|
},
|
||
|
bufferFrom: function(arrayBuffer) {
|
||
|
return Buffer.alloc ? Buffer.from(arrayBuffer) : new Buffer(arrayBuffer);
|
||
|
},
|
||
|
mount: function(mount) {
|
||
|
assert(ENVIRONMENT_IS_NODE);
|
||
|
return NODEFS.createNode(null, "/", NODEFS.getMode(mount.opts.root), 0);
|
||
|
},
|
||
|
createNode: function(parent, name, mode, dev) {
|
||
|
if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
var node = FS.createNode(parent, name, mode);
|
||
|
node.node_ops = NODEFS.node_ops;
|
||
|
node.stream_ops = NODEFS.stream_ops;
|
||
|
return node;
|
||
|
},
|
||
|
getMode: function(path) {
|
||
|
var stat;
|
||
|
try {
|
||
|
stat = fs.lstatSync(path);
|
||
|
if (NODEFS.isWindows) {
|
||
|
stat.mode = stat.mode | (stat.mode & 292) >> 2;
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
return stat.mode;
|
||
|
},
|
||
|
realPath: function(node) {
|
||
|
var parts = [];
|
||
|
while (node.parent !== node) {
|
||
|
parts.push(node.name);
|
||
|
node = node.parent;
|
||
|
}
|
||
|
parts.push(node.mount.opts.root);
|
||
|
parts.reverse();
|
||
|
return PATH.join.apply(null, parts);
|
||
|
},
|
||
|
flagsForNode: function(flags) {
|
||
|
flags &= ~2097152;
|
||
|
flags &= ~2048;
|
||
|
flags &= ~32768;
|
||
|
flags &= ~524288;
|
||
|
var newFlags = 0;
|
||
|
for (var k in NODEFS.flagsForNodeMap) {
|
||
|
if (flags & k) {
|
||
|
newFlags |= NODEFS.flagsForNodeMap[k];
|
||
|
flags ^= k;
|
||
|
}
|
||
|
}
|
||
|
if (!flags) {
|
||
|
return newFlags;
|
||
|
} else {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
},
|
||
|
node_ops: {
|
||
|
getattr: function(node) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
var stat;
|
||
|
try {
|
||
|
stat = fs.lstatSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
if (NODEFS.isWindows && !stat.blksize) {
|
||
|
stat.blksize = 4096;
|
||
|
}
|
||
|
if (NODEFS.isWindows && !stat.blocks) {
|
||
|
stat.blocks = (stat.size + stat.blksize - 1) / stat.blksize | 0;
|
||
|
}
|
||
|
return {
|
||
|
dev: stat.dev,
|
||
|
ino: stat.ino,
|
||
|
mode: stat.mode,
|
||
|
nlink: stat.nlink,
|
||
|
uid: stat.uid,
|
||
|
gid: stat.gid,
|
||
|
rdev: stat.rdev,
|
||
|
size: stat.size,
|
||
|
atime: stat.atime,
|
||
|
mtime: stat.mtime,
|
||
|
ctime: stat.ctime,
|
||
|
blksize: stat.blksize,
|
||
|
blocks: stat.blocks
|
||
|
};
|
||
|
},
|
||
|
setattr: function(node, attr) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
if (attr.mode !== undefined) {
|
||
|
fs.chmodSync(path, attr.mode);
|
||
|
node.mode = attr.mode;
|
||
|
}
|
||
|
if (attr.timestamp !== undefined) {
|
||
|
var date = new Date(attr.timestamp);
|
||
|
fs.utimesSync(path, date, date);
|
||
|
}
|
||
|
if (attr.size !== undefined) {
|
||
|
fs.truncateSync(path, attr.size);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
lookup: function(parent, name) {
|
||
|
var path = PATH.join2(NODEFS.realPath(parent), name);
|
||
|
var mode = NODEFS.getMode(path);
|
||
|
return NODEFS.createNode(parent, name, mode);
|
||
|
},
|
||
|
mknod: function(parent, name, mode, dev) {
|
||
|
var node = NODEFS.createNode(parent, name, mode, dev);
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
fs.mkdirSync(path, node.mode);
|
||
|
} else {
|
||
|
fs.writeFileSync(path, "", {
|
||
|
mode: node.mode
|
||
|
});
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
return node;
|
||
|
},
|
||
|
rename: function(oldNode, newDir, newName) {
|
||
|
var oldPath = NODEFS.realPath(oldNode);
|
||
|
var newPath = PATH.join2(NODEFS.realPath(newDir), newName);
|
||
|
try {
|
||
|
fs.renameSync(oldPath, newPath);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
unlink: function(parent, name) {
|
||
|
var path = PATH.join2(NODEFS.realPath(parent), name);
|
||
|
try {
|
||
|
fs.unlinkSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
rmdir: function(parent, name) {
|
||
|
var path = PATH.join2(NODEFS.realPath(parent), name);
|
||
|
try {
|
||
|
fs.rmdirSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
readdir: function(node) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
return fs.readdirSync(path);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
symlink: function(parent, newName, oldPath) {
|
||
|
var newPath = PATH.join2(NODEFS.realPath(parent), newName);
|
||
|
try {
|
||
|
fs.symlinkSync(oldPath, newPath);
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
readlink: function(node) {
|
||
|
var path = NODEFS.realPath(node);
|
||
|
try {
|
||
|
path = fs.readlinkSync(path);
|
||
|
path = NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root), path);
|
||
|
return path;
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
stream_ops: {
|
||
|
open: function(stream) {
|
||
|
var path = NODEFS.realPath(stream.node);
|
||
|
try {
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
stream.nfd = fs.openSync(path, NODEFS.flagsForNode(stream.flags));
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
close: function(stream) {
|
||
|
try {
|
||
|
if (FS.isFile(stream.node.mode) && stream.nfd) {
|
||
|
fs.closeSync(stream.nfd);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (!e.code) throw e;
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
read: function(stream, buffer, offset, length, position) {
|
||
|
if (length === 0) return 0;
|
||
|
try {
|
||
|
return fs.readSync(stream.nfd, NODEFS.bufferFrom(buffer.buffer), offset, length, position);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, position) {
|
||
|
try {
|
||
|
return fs.writeSync(stream.nfd, NODEFS.bufferFrom(buffer.buffer), offset, length, position);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
},
|
||
|
llseek: function(stream, offset, whence) {
|
||
|
var position = offset;
|
||
|
if (whence === 1) {
|
||
|
position += stream.position;
|
||
|
} else if (whence === 2) {
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
try {
|
||
|
var stat = fs.fstatSync(stream.nfd);
|
||
|
position += stat.size;
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES[e.code]);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
return position;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var WORKERFS = {
|
||
|
DIR_MODE: 16895,
|
||
|
FILE_MODE: 33279,
|
||
|
reader: null,
|
||
|
mount: function(mount) {
|
||
|
assert(ENVIRONMENT_IS_WORKER);
|
||
|
if (!WORKERFS.reader) WORKERFS.reader = new FileReaderSync();
|
||
|
var root = WORKERFS.createNode(null, "/", WORKERFS.DIR_MODE, 0);
|
||
|
var createdParents = {};
|
||
|
function ensureParent(path) {
|
||
|
var parts = path.split("/");
|
||
|
var parent = root;
|
||
|
for (var i = 0; i < parts.length - 1; i++) {
|
||
|
var curr = parts.slice(0, i + 1).join("/");
|
||
|
if (!createdParents[curr]) {
|
||
|
createdParents[curr] = WORKERFS.createNode(parent, parts[i], WORKERFS.DIR_MODE, 0);
|
||
|
}
|
||
|
parent = createdParents[curr];
|
||
|
}
|
||
|
return parent;
|
||
|
}
|
||
|
function base(path) {
|
||
|
var parts = path.split("/");
|
||
|
return parts[parts.length - 1];
|
||
|
}
|
||
|
Array.prototype.forEach.call(mount.opts["files"] || [], function(file) {
|
||
|
WORKERFS.createNode(ensureParent(file.name), base(file.name), WORKERFS.FILE_MODE, 0, file, file.lastModifiedDate);
|
||
|
});
|
||
|
(mount.opts["blobs"] || []).forEach(function(obj) {
|
||
|
WORKERFS.createNode(ensureParent(obj["name"]), base(obj["name"]), WORKERFS.FILE_MODE, 0, obj["data"]);
|
||
|
});
|
||
|
(mount.opts["packages"] || []).forEach(function(pack) {
|
||
|
pack["metadata"].files.forEach(function(file) {
|
||
|
var name = file.filename.substr(1);
|
||
|
WORKERFS.createNode(ensureParent(name), base(name), WORKERFS.FILE_MODE, 0, pack["blob"].slice(file.start, file.end));
|
||
|
});
|
||
|
});
|
||
|
return root;
|
||
|
},
|
||
|
createNode: function(parent, name, mode, dev, contents, mtime) {
|
||
|
var node = FS.createNode(parent, name, mode);
|
||
|
node.mode = mode;
|
||
|
node.node_ops = WORKERFS.node_ops;
|
||
|
node.stream_ops = WORKERFS.stream_ops;
|
||
|
node.timestamp = (mtime || new Date()).getTime();
|
||
|
assert(WORKERFS.FILE_MODE !== WORKERFS.DIR_MODE);
|
||
|
if (mode === WORKERFS.FILE_MODE) {
|
||
|
node.size = contents.size;
|
||
|
node.contents = contents;
|
||
|
} else {
|
||
|
node.size = 4096;
|
||
|
node.contents = {};
|
||
|
}
|
||
|
if (parent) {
|
||
|
parent.contents[name] = node;
|
||
|
}
|
||
|
return node;
|
||
|
},
|
||
|
node_ops: {
|
||
|
getattr: function(node) {
|
||
|
return {
|
||
|
dev: 1,
|
||
|
ino: undefined,
|
||
|
mode: node.mode,
|
||
|
nlink: 1,
|
||
|
uid: 0,
|
||
|
gid: 0,
|
||
|
rdev: undefined,
|
||
|
size: node.size,
|
||
|
atime: new Date(node.timestamp),
|
||
|
mtime: new Date(node.timestamp),
|
||
|
ctime: new Date(node.timestamp),
|
||
|
blksize: 4096,
|
||
|
blocks: Math.ceil(node.size / 4096)
|
||
|
};
|
||
|
},
|
||
|
setattr: function(node, attr) {
|
||
|
if (attr.mode !== undefined) {
|
||
|
node.mode = attr.mode;
|
||
|
}
|
||
|
if (attr.timestamp !== undefined) {
|
||
|
node.timestamp = attr.timestamp;
|
||
|
}
|
||
|
},
|
||
|
lookup: function(parent, name) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
|
||
|
},
|
||
|
mknod: function(parent, name, mode, dev) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
},
|
||
|
rename: function(oldNode, newDir, newName) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
},
|
||
|
unlink: function(parent, name) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
},
|
||
|
rmdir: function(parent, name) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
},
|
||
|
readdir: function(node) {
|
||
|
var entries = [ ".", ".." ];
|
||
|
for (var key in node.contents) {
|
||
|
if (!node.contents.hasOwnProperty(key)) {
|
||
|
continue;
|
||
|
}
|
||
|
entries.push(key);
|
||
|
}
|
||
|
return entries;
|
||
|
},
|
||
|
symlink: function(parent, newName, oldPath) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
},
|
||
|
readlink: function(node) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
|
||
|
}
|
||
|
},
|
||
|
stream_ops: {
|
||
|
read: function(stream, buffer, offset, length, position) {
|
||
|
if (position >= stream.node.size) return 0;
|
||
|
var chunk = stream.node.contents.slice(position, position + length);
|
||
|
var ab = WORKERFS.reader.readAsArrayBuffer(chunk);
|
||
|
buffer.set(new Uint8Array(ab), offset);
|
||
|
return chunk.size;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, position) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EIO);
|
||
|
},
|
||
|
llseek: function(stream, offset, whence) {
|
||
|
var position = offset;
|
||
|
if (whence === 1) {
|
||
|
position += stream.position;
|
||
|
} else if (whence === 2) {
|
||
|
if (FS.isFile(stream.node.mode)) {
|
||
|
position += stream.node.size;
|
||
|
}
|
||
|
}
|
||
|
if (position < 0) {
|
||
|
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
|
||
|
}
|
||
|
return position;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var FS = {
|
||
|
root: null,
|
||
|
mounts: [],
|
||
|
devices: {},
|
||
|
streams: [],
|
||
|
nextInode: 1,
|
||
|
nameTable: null,
|
||
|
currentPath: "/",
|
||
|
initialized: false,
|
||
|
ignorePermissions: true,
|
||
|
trackingDelegate: {},
|
||
|
tracking: {
|
||
|
openFlags: {
|
||
|
READ: 1,
|
||
|
WRITE: 2
|
||
|
}
|
||
|
},
|
||
|
ErrnoError: null,
|
||
|
genericErrors: {},
|
||
|
filesystems: null,
|
||
|
syncFSRequests: 0,
|
||
|
handleFSError: function(e) {
|
||
|
if (!(e instanceof FS.ErrnoError)) throw e + " : " + stackTrace();
|
||
|
return ___setErrNo(e.errno);
|
||
|
},
|
||
|
lookupPath: function(path, opts) {
|
||
|
path = PATH.resolve(FS.cwd(), path);
|
||
|
opts = opts || {};
|
||
|
if (!path) return {
|
||
|
path: "",
|
||
|
node: null
|
||
|
};
|
||
|
var defaults = {
|
||
|
follow_mount: true,
|
||
|
recurse_count: 0
|
||
|
};
|
||
|
for (var key in defaults) {
|
||
|
if (opts[key] === undefined) {
|
||
|
opts[key] = defaults[key];
|
||
|
}
|
||
|
}
|
||
|
if (opts.recurse_count > 8) {
|
||
|
throw new FS.ErrnoError(40);
|
||
|
}
|
||
|
var parts = PATH.normalizeArray(path.split("/").filter(function(p) {
|
||
|
return !!p;
|
||
|
}), false);
|
||
|
var current = FS.root;
|
||
|
var current_path = "/";
|
||
|
for (var i = 0; i < parts.length; i++) {
|
||
|
var islast = i === parts.length - 1;
|
||
|
if (islast && opts.parent) {
|
||
|
break;
|
||
|
}
|
||
|
current = FS.lookupNode(current, parts[i]);
|
||
|
current_path = PATH.join2(current_path, parts[i]);
|
||
|
if (FS.isMountpoint(current)) {
|
||
|
if (!islast || islast && opts.follow_mount) {
|
||
|
current = current.mounted.root;
|
||
|
}
|
||
|
}
|
||
|
if (!islast || opts.follow) {
|
||
|
var count = 0;
|
||
|
while (FS.isLink(current.mode)) {
|
||
|
var link = FS.readlink(current_path);
|
||
|
current_path = PATH.resolve(PATH.dirname(current_path), link);
|
||
|
var lookup = FS.lookupPath(current_path, {
|
||
|
recurse_count: opts.recurse_count
|
||
|
});
|
||
|
current = lookup.node;
|
||
|
if (count++ > 40) {
|
||
|
throw new FS.ErrnoError(40);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return {
|
||
|
path: current_path,
|
||
|
node: current
|
||
|
};
|
||
|
},
|
||
|
getPath: function(node) {
|
||
|
var path;
|
||
|
while (true) {
|
||
|
if (FS.isRoot(node)) {
|
||
|
var mount = node.mount.mountpoint;
|
||
|
if (!path) return mount;
|
||
|
return mount[mount.length - 1] !== "/" ? mount + "/" + path : mount + path;
|
||
|
}
|
||
|
path = path ? node.name + "/" + path : node.name;
|
||
|
node = node.parent;
|
||
|
}
|
||
|
},
|
||
|
hashName: function(parentid, name) {
|
||
|
var hash = 0;
|
||
|
for (var i = 0; i < name.length; i++) {
|
||
|
hash = (hash << 5) - hash + name.charCodeAt(i) | 0;
|
||
|
}
|
||
|
return (parentid + hash >>> 0) % FS.nameTable.length;
|
||
|
},
|
||
|
hashAddNode: function(node) {
|
||
|
var hash = FS.hashName(node.parent.id, node.name);
|
||
|
node.name_next = FS.nameTable[hash];
|
||
|
FS.nameTable[hash] = node;
|
||
|
},
|
||
|
hashRemoveNode: function(node) {
|
||
|
var hash = FS.hashName(node.parent.id, node.name);
|
||
|
if (FS.nameTable[hash] === node) {
|
||
|
FS.nameTable[hash] = node.name_next;
|
||
|
} else {
|
||
|
var current = FS.nameTable[hash];
|
||
|
while (current) {
|
||
|
if (current.name_next === node) {
|
||
|
current.name_next = node.name_next;
|
||
|
break;
|
||
|
}
|
||
|
current = current.name_next;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
lookupNode: function(parent, name) {
|
||
|
var err = FS.mayLookup(parent);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err, parent);
|
||
|
}
|
||
|
var hash = FS.hashName(parent.id, name);
|
||
|
for (var node = FS.nameTable[hash]; node; node = node.name_next) {
|
||
|
var nodeName = node.name;
|
||
|
if (node.parent.id === parent.id && nodeName === name) {
|
||
|
return node;
|
||
|
}
|
||
|
}
|
||
|
return FS.lookup(parent, name);
|
||
|
},
|
||
|
createNode: function(parent, name, mode, rdev) {
|
||
|
if (!FS.FSNode) {
|
||
|
FS.FSNode = function(parent, name, mode, rdev) {
|
||
|
if (!parent) {
|
||
|
parent = this;
|
||
|
}
|
||
|
this.parent = parent;
|
||
|
this.mount = parent.mount;
|
||
|
this.mounted = null;
|
||
|
this.id = FS.nextInode++;
|
||
|
this.name = name;
|
||
|
this.mode = mode;
|
||
|
this.node_ops = {};
|
||
|
this.stream_ops = {};
|
||
|
this.rdev = rdev;
|
||
|
};
|
||
|
FS.FSNode.prototype = {};
|
||
|
var readMode = 292 | 73;
|
||
|
var writeMode = 146;
|
||
|
Object.defineProperties(FS.FSNode.prototype, {
|
||
|
read: {
|
||
|
get: function() {
|
||
|
return (this.mode & readMode) === readMode;
|
||
|
},
|
||
|
set: function(val) {
|
||
|
val ? this.mode |= readMode : this.mode &= ~readMode;
|
||
|
}
|
||
|
},
|
||
|
write: {
|
||
|
get: function() {
|
||
|
return (this.mode & writeMode) === writeMode;
|
||
|
},
|
||
|
set: function(val) {
|
||
|
val ? this.mode |= writeMode : this.mode &= ~writeMode;
|
||
|
}
|
||
|
},
|
||
|
isFolder: {
|
||
|
get: function() {
|
||
|
return FS.isDir(this.mode);
|
||
|
}
|
||
|
},
|
||
|
isDevice: {
|
||
|
get: function() {
|
||
|
return FS.isChrdev(this.mode);
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
var node = new FS.FSNode(parent, name, mode, rdev);
|
||
|
FS.hashAddNode(node);
|
||
|
return node;
|
||
|
},
|
||
|
destroyNode: function(node) {
|
||
|
FS.hashRemoveNode(node);
|
||
|
},
|
||
|
isRoot: function(node) {
|
||
|
return node === node.parent;
|
||
|
},
|
||
|
isMountpoint: function(node) {
|
||
|
return !!node.mounted;
|
||
|
},
|
||
|
isFile: function(mode) {
|
||
|
return (mode & 61440) === 32768;
|
||
|
},
|
||
|
isDir: function(mode) {
|
||
|
return (mode & 61440) === 16384;
|
||
|
},
|
||
|
isLink: function(mode) {
|
||
|
return (mode & 61440) === 40960;
|
||
|
},
|
||
|
isChrdev: function(mode) {
|
||
|
return (mode & 61440) === 8192;
|
||
|
},
|
||
|
isBlkdev: function(mode) {
|
||
|
return (mode & 61440) === 24576;
|
||
|
},
|
||
|
isFIFO: function(mode) {
|
||
|
return (mode & 61440) === 4096;
|
||
|
},
|
||
|
isSocket: function(mode) {
|
||
|
return (mode & 49152) === 49152;
|
||
|
},
|
||
|
flagModes: {
|
||
|
"r": 0,
|
||
|
"rs": 1052672,
|
||
|
"r+": 2,
|
||
|
"w": 577,
|
||
|
"wx": 705,
|
||
|
"xw": 705,
|
||
|
"w+": 578,
|
||
|
"wx+": 706,
|
||
|
"xw+": 706,
|
||
|
"a": 1089,
|
||
|
"ax": 1217,
|
||
|
"xa": 1217,
|
||
|
"a+": 1090,
|
||
|
"ax+": 1218,
|
||
|
"xa+": 1218
|
||
|
},
|
||
|
modeStringToFlags: function(str) {
|
||
|
var flags = FS.flagModes[str];
|
||
|
if (typeof flags === "undefined") {
|
||
|
throw new Error("Unknown file open mode: " + str);
|
||
|
}
|
||
|
return flags;
|
||
|
},
|
||
|
flagsToPermissionString: function(flag) {
|
||
|
var perms = [ "r", "w", "rw" ][flag & 3];
|
||
|
if (flag & 512) {
|
||
|
perms += "w";
|
||
|
}
|
||
|
return perms;
|
||
|
},
|
||
|
nodePermissions: function(node, perms) {
|
||
|
if (FS.ignorePermissions) {
|
||
|
return 0;
|
||
|
}
|
||
|
if (perms.indexOf("r") !== -1 && !(node.mode & 292)) {
|
||
|
return 13;
|
||
|
} else if (perms.indexOf("w") !== -1 && !(node.mode & 146)) {
|
||
|
return 13;
|
||
|
} else if (perms.indexOf("x") !== -1 && !(node.mode & 73)) {
|
||
|
return 13;
|
||
|
}
|
||
|
return 0;
|
||
|
},
|
||
|
mayLookup: function(dir) {
|
||
|
var err = FS.nodePermissions(dir, "x");
|
||
|
if (err) return err;
|
||
|
if (!dir.node_ops.lookup) return 13;
|
||
|
return 0;
|
||
|
},
|
||
|
mayCreate: function(dir, name) {
|
||
|
try {
|
||
|
var node = FS.lookupNode(dir, name);
|
||
|
return 17;
|
||
|
} catch (e) {}
|
||
|
return FS.nodePermissions(dir, "wx");
|
||
|
},
|
||
|
mayDelete: function(dir, name, isdir) {
|
||
|
var node;
|
||
|
try {
|
||
|
node = FS.lookupNode(dir, name);
|
||
|
} catch (e) {
|
||
|
return e.errno;
|
||
|
}
|
||
|
var err = FS.nodePermissions(dir, "wx");
|
||
|
if (err) {
|
||
|
return err;
|
||
|
}
|
||
|
if (isdir) {
|
||
|
if (!FS.isDir(node.mode)) {
|
||
|
return 20;
|
||
|
}
|
||
|
if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
|
||
|
return 16;
|
||
|
}
|
||
|
} else {
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
return 21;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
},
|
||
|
mayOpen: function(node, flags) {
|
||
|
if (!node) {
|
||
|
return 2;
|
||
|
}
|
||
|
if (FS.isLink(node.mode)) {
|
||
|
return 40;
|
||
|
} else if (FS.isDir(node.mode)) {
|
||
|
if (FS.flagsToPermissionString(flags) !== "r" || flags & 512) {
|
||
|
return 21;
|
||
|
}
|
||
|
}
|
||
|
return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
|
||
|
},
|
||
|
MAX_OPEN_FDS: 4096,
|
||
|
nextfd: function(fd_start, fd_end) {
|
||
|
fd_start = fd_start || 0;
|
||
|
fd_end = fd_end || FS.MAX_OPEN_FDS;
|
||
|
for (var fd = fd_start; fd <= fd_end; fd++) {
|
||
|
if (!FS.streams[fd]) {
|
||
|
return fd;
|
||
|
}
|
||
|
}
|
||
|
throw new FS.ErrnoError(24);
|
||
|
},
|
||
|
getStream: function(fd) {
|
||
|
return FS.streams[fd];
|
||
|
},
|
||
|
createStream: function(stream, fd_start, fd_end) {
|
||
|
if (!FS.FSStream) {
|
||
|
FS.FSStream = function() {};
|
||
|
FS.FSStream.prototype = {};
|
||
|
Object.defineProperties(FS.FSStream.prototype, {
|
||
|
object: {
|
||
|
get: function() {
|
||
|
return this.node;
|
||
|
},
|
||
|
set: function(val) {
|
||
|
this.node = val;
|
||
|
}
|
||
|
},
|
||
|
isRead: {
|
||
|
get: function() {
|
||
|
return (this.flags & 2097155) !== 1;
|
||
|
}
|
||
|
},
|
||
|
isWrite: {
|
||
|
get: function() {
|
||
|
return (this.flags & 2097155) !== 0;
|
||
|
}
|
||
|
},
|
||
|
isAppend: {
|
||
|
get: function() {
|
||
|
return this.flags & 1024;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
var newStream = new FS.FSStream();
|
||
|
for (var p in stream) {
|
||
|
newStream[p] = stream[p];
|
||
|
}
|
||
|
stream = newStream;
|
||
|
var fd = FS.nextfd(fd_start, fd_end);
|
||
|
stream.fd = fd;
|
||
|
FS.streams[fd] = stream;
|
||
|
return stream;
|
||
|
},
|
||
|
closeStream: function(fd) {
|
||
|
FS.streams[fd] = null;
|
||
|
},
|
||
|
chrdev_stream_ops: {
|
||
|
open: function(stream) {
|
||
|
var device = FS.getDevice(stream.node.rdev);
|
||
|
stream.stream_ops = device.stream_ops;
|
||
|
if (stream.stream_ops.open) {
|
||
|
stream.stream_ops.open(stream);
|
||
|
}
|
||
|
},
|
||
|
llseek: function() {
|
||
|
throw new FS.ErrnoError(29);
|
||
|
}
|
||
|
},
|
||
|
major: function(dev) {
|
||
|
return dev >> 8;
|
||
|
},
|
||
|
minor: function(dev) {
|
||
|
return dev & 255;
|
||
|
},
|
||
|
makedev: function(ma, mi) {
|
||
|
return ma << 8 | mi;
|
||
|
},
|
||
|
registerDevice: function(dev, ops) {
|
||
|
FS.devices[dev] = {
|
||
|
stream_ops: ops
|
||
|
};
|
||
|
},
|
||
|
getDevice: function(dev) {
|
||
|
return FS.devices[dev];
|
||
|
},
|
||
|
getMounts: function(mount) {
|
||
|
var mounts = [];
|
||
|
var check = [ mount ];
|
||
|
while (check.length) {
|
||
|
var m = check.pop();
|
||
|
mounts.push(m);
|
||
|
check.push.apply(check, m.mounts);
|
||
|
}
|
||
|
return mounts;
|
||
|
},
|
||
|
syncfs: function(populate, callback) {
|
||
|
if (typeof populate === "function") {
|
||
|
callback = populate;
|
||
|
populate = false;
|
||
|
}
|
||
|
FS.syncFSRequests++;
|
||
|
if (FS.syncFSRequests > 1) {
|
||
|
console.log("warning: " + FS.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work");
|
||
|
}
|
||
|
var mounts = FS.getMounts(FS.root.mount);
|
||
|
var completed = 0;
|
||
|
function doCallback(err) {
|
||
|
assert(FS.syncFSRequests > 0);
|
||
|
FS.syncFSRequests--;
|
||
|
return callback(err);
|
||
|
}
|
||
|
function done(err) {
|
||
|
if (err) {
|
||
|
if (!done.errored) {
|
||
|
done.errored = true;
|
||
|
return doCallback(err);
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
if (++completed >= mounts.length) {
|
||
|
doCallback(null);
|
||
|
}
|
||
|
}
|
||
|
mounts.forEach(function(mount) {
|
||
|
if (!mount.type.syncfs) {
|
||
|
return done(null);
|
||
|
}
|
||
|
mount.type.syncfs(mount, populate, done);
|
||
|
});
|
||
|
},
|
||
|
mount: function(type, opts, mountpoint) {
|
||
|
var root = mountpoint === "/";
|
||
|
var pseudo = !mountpoint;
|
||
|
var node;
|
||
|
if (root && FS.root) {
|
||
|
throw new FS.ErrnoError(16);
|
||
|
} else if (!root && !pseudo) {
|
||
|
var lookup = FS.lookupPath(mountpoint, {
|
||
|
follow_mount: false
|
||
|
});
|
||
|
mountpoint = lookup.path;
|
||
|
node = lookup.node;
|
||
|
if (FS.isMountpoint(node)) {
|
||
|
throw new FS.ErrnoError(16);
|
||
|
}
|
||
|
if (!FS.isDir(node.mode)) {
|
||
|
throw new FS.ErrnoError(20);
|
||
|
}
|
||
|
}
|
||
|
var mount = {
|
||
|
type: type,
|
||
|
opts: opts,
|
||
|
mountpoint: mountpoint,
|
||
|
mounts: []
|
||
|
};
|
||
|
var mountRoot = type.mount(mount);
|
||
|
mountRoot.mount = mount;
|
||
|
mount.root = mountRoot;
|
||
|
if (root) {
|
||
|
FS.root = mountRoot;
|
||
|
} else if (node) {
|
||
|
node.mounted = mount;
|
||
|
if (node.mount) {
|
||
|
node.mount.mounts.push(mount);
|
||
|
}
|
||
|
}
|
||
|
return mountRoot;
|
||
|
},
|
||
|
unmount: function(mountpoint) {
|
||
|
var lookup = FS.lookupPath(mountpoint, {
|
||
|
follow_mount: false
|
||
|
});
|
||
|
if (!FS.isMountpoint(lookup.node)) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
var node = lookup.node;
|
||
|
var mount = node.mounted;
|
||
|
var mounts = FS.getMounts(mount);
|
||
|
Object.keys(FS.nameTable).forEach(function(hash) {
|
||
|
var current = FS.nameTable[hash];
|
||
|
while (current) {
|
||
|
var next = current.name_next;
|
||
|
if (mounts.indexOf(current.mount) !== -1) {
|
||
|
FS.destroyNode(current);
|
||
|
}
|
||
|
current = next;
|
||
|
}
|
||
|
});
|
||
|
node.mounted = null;
|
||
|
var idx = node.mount.mounts.indexOf(mount);
|
||
|
assert(idx !== -1);
|
||
|
node.mount.mounts.splice(idx, 1);
|
||
|
},
|
||
|
lookup: function(parent, name) {
|
||
|
return parent.node_ops.lookup(parent, name);
|
||
|
},
|
||
|
mknod: function(path, mode, dev) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
parent: true
|
||
|
});
|
||
|
var parent = lookup.node;
|
||
|
var name = PATH.basename(path);
|
||
|
if (!name || name === "." || name === "..") {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
var err = FS.mayCreate(parent, name);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.mknod) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
return parent.node_ops.mknod(parent, name, mode, dev);
|
||
|
},
|
||
|
create: function(path, mode) {
|
||
|
mode = mode !== undefined ? mode : 438;
|
||
|
mode &= 4095;
|
||
|
mode |= 32768;
|
||
|
return FS.mknod(path, mode, 0);
|
||
|
},
|
||
|
mkdir: function(path, mode) {
|
||
|
mode = mode !== undefined ? mode : 511;
|
||
|
mode &= 511 | 512;
|
||
|
mode |= 16384;
|
||
|
return FS.mknod(path, mode, 0);
|
||
|
},
|
||
|
mkdirTree: function(path, mode) {
|
||
|
var dirs = path.split("/");
|
||
|
var d = "";
|
||
|
for (var i = 0; i < dirs.length; ++i) {
|
||
|
if (!dirs[i]) continue;
|
||
|
d += "/" + dirs[i];
|
||
|
try {
|
||
|
FS.mkdir(d, mode);
|
||
|
} catch (e) {
|
||
|
if (e.errno != 17) throw e;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
mkdev: function(path, mode, dev) {
|
||
|
if (typeof dev === "undefined") {
|
||
|
dev = mode;
|
||
|
mode = 438;
|
||
|
}
|
||
|
mode |= 8192;
|
||
|
return FS.mknod(path, mode, dev);
|
||
|
},
|
||
|
symlink: function(oldpath, newpath) {
|
||
|
if (!PATH.resolve(oldpath)) {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
var lookup = FS.lookupPath(newpath, {
|
||
|
parent: true
|
||
|
});
|
||
|
var parent = lookup.node;
|
||
|
if (!parent) {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
var newname = PATH.basename(newpath);
|
||
|
var err = FS.mayCreate(parent, newname);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.symlink) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
return parent.node_ops.symlink(parent, newname, oldpath);
|
||
|
},
|
||
|
rename: function(old_path, new_path) {
|
||
|
var old_dirname = PATH.dirname(old_path);
|
||
|
var new_dirname = PATH.dirname(new_path);
|
||
|
var old_name = PATH.basename(old_path);
|
||
|
var new_name = PATH.basename(new_path);
|
||
|
var lookup, old_dir, new_dir;
|
||
|
try {
|
||
|
lookup = FS.lookupPath(old_path, {
|
||
|
parent: true
|
||
|
});
|
||
|
old_dir = lookup.node;
|
||
|
lookup = FS.lookupPath(new_path, {
|
||
|
parent: true
|
||
|
});
|
||
|
new_dir = lookup.node;
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(16);
|
||
|
}
|
||
|
if (!old_dir || !new_dir) throw new FS.ErrnoError(2);
|
||
|
if (old_dir.mount !== new_dir.mount) {
|
||
|
throw new FS.ErrnoError(18);
|
||
|
}
|
||
|
var old_node = FS.lookupNode(old_dir, old_name);
|
||
|
var relative = PATH.relative(old_path, new_dirname);
|
||
|
if (relative.charAt(0) !== ".") {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
relative = PATH.relative(new_path, old_dirname);
|
||
|
if (relative.charAt(0) !== ".") {
|
||
|
throw new FS.ErrnoError(39);
|
||
|
}
|
||
|
var new_node;
|
||
|
try {
|
||
|
new_node = FS.lookupNode(new_dir, new_name);
|
||
|
} catch (e) {}
|
||
|
if (old_node === new_node) {
|
||
|
return;
|
||
|
}
|
||
|
var isdir = FS.isDir(old_node.mode);
|
||
|
var err = FS.mayDelete(old_dir, old_name, isdir);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
err = new_node ? FS.mayDelete(new_dir, new_name, isdir) : FS.mayCreate(new_dir, new_name);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!old_dir.node_ops.rename) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
if (FS.isMountpoint(old_node) || new_node && FS.isMountpoint(new_node)) {
|
||
|
throw new FS.ErrnoError(16);
|
||
|
}
|
||
|
if (new_dir !== old_dir) {
|
||
|
err = FS.nodePermissions(old_dir, "w");
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
}
|
||
|
try {
|
||
|
if (FS.trackingDelegate["willMovePath"]) {
|
||
|
FS.trackingDelegate["willMovePath"](old_path, new_path);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['willMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
FS.hashRemoveNode(old_node);
|
||
|
try {
|
||
|
old_dir.node_ops.rename(old_node, new_dir, new_name);
|
||
|
} catch (e) {
|
||
|
throw e;
|
||
|
} finally {
|
||
|
FS.hashAddNode(old_node);
|
||
|
}
|
||
|
try {
|
||
|
if (FS.trackingDelegate["onMovePath"]) FS.trackingDelegate["onMovePath"](old_path, new_path);
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['onMovePath']('" + old_path + "', '" + new_path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
},
|
||
|
rmdir: function(path) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
parent: true
|
||
|
});
|
||
|
var parent = lookup.node;
|
||
|
var name = PATH.basename(path);
|
||
|
var node = FS.lookupNode(parent, name);
|
||
|
var err = FS.mayDelete(parent, name, true);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.rmdir) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
if (FS.isMountpoint(node)) {
|
||
|
throw new FS.ErrnoError(16);
|
||
|
}
|
||
|
try {
|
||
|
if (FS.trackingDelegate["willDeletePath"]) {
|
||
|
FS.trackingDelegate["willDeletePath"](path);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
parent.node_ops.rmdir(parent, name);
|
||
|
FS.destroyNode(node);
|
||
|
try {
|
||
|
if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path);
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
},
|
||
|
readdir: function(path) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: true
|
||
|
});
|
||
|
var node = lookup.node;
|
||
|
if (!node.node_ops.readdir) {
|
||
|
throw new FS.ErrnoError(20);
|
||
|
}
|
||
|
return node.node_ops.readdir(node);
|
||
|
},
|
||
|
unlink: function(path) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
parent: true
|
||
|
});
|
||
|
var parent = lookup.node;
|
||
|
var name = PATH.basename(path);
|
||
|
var node = FS.lookupNode(parent, name);
|
||
|
var err = FS.mayDelete(parent, name, false);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
if (!parent.node_ops.unlink) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
if (FS.isMountpoint(node)) {
|
||
|
throw new FS.ErrnoError(16);
|
||
|
}
|
||
|
try {
|
||
|
if (FS.trackingDelegate["willDeletePath"]) {
|
||
|
FS.trackingDelegate["willDeletePath"](path);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['willDeletePath']('" + path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
parent.node_ops.unlink(parent, name);
|
||
|
FS.destroyNode(node);
|
||
|
try {
|
||
|
if (FS.trackingDelegate["onDeletePath"]) FS.trackingDelegate["onDeletePath"](path);
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['onDeletePath']('" + path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
},
|
||
|
readlink: function(path) {
|
||
|
var lookup = FS.lookupPath(path);
|
||
|
var link = lookup.node;
|
||
|
if (!link) {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
if (!link.node_ops.readlink) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
return PATH.resolve(FS.getPath(link.parent), link.node_ops.readlink(link));
|
||
|
},
|
||
|
stat: function(path, dontFollow) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: !dontFollow
|
||
|
});
|
||
|
var node = lookup.node;
|
||
|
if (!node) {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
if (!node.node_ops.getattr) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
return node.node_ops.getattr(node);
|
||
|
},
|
||
|
lstat: function(path) {
|
||
|
return FS.stat(path, true);
|
||
|
},
|
||
|
chmod: function(path, mode, dontFollow) {
|
||
|
var node;
|
||
|
if (typeof path === "string") {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: !dontFollow
|
||
|
});
|
||
|
node = lookup.node;
|
||
|
} else {
|
||
|
node = path;
|
||
|
}
|
||
|
if (!node.node_ops.setattr) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
node.node_ops.setattr(node, {
|
||
|
mode: mode & 4095 | node.mode & ~4095,
|
||
|
timestamp: Date.now()
|
||
|
});
|
||
|
},
|
||
|
lchmod: function(path, mode) {
|
||
|
FS.chmod(path, mode, true);
|
||
|
},
|
||
|
fchmod: function(fd, mode) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
FS.chmod(stream.node, mode);
|
||
|
},
|
||
|
chown: function(path, uid, gid, dontFollow) {
|
||
|
var node;
|
||
|
if (typeof path === "string") {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: !dontFollow
|
||
|
});
|
||
|
node = lookup.node;
|
||
|
} else {
|
||
|
node = path;
|
||
|
}
|
||
|
if (!node.node_ops.setattr) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
node.node_ops.setattr(node, {
|
||
|
timestamp: Date.now()
|
||
|
});
|
||
|
},
|
||
|
lchown: function(path, uid, gid) {
|
||
|
FS.chown(path, uid, gid, true);
|
||
|
},
|
||
|
fchown: function(fd, uid, gid) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
FS.chown(stream.node, uid, gid);
|
||
|
},
|
||
|
truncate: function(path, len) {
|
||
|
if (len < 0) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
var node;
|
||
|
if (typeof path === "string") {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: true
|
||
|
});
|
||
|
node = lookup.node;
|
||
|
} else {
|
||
|
node = path;
|
||
|
}
|
||
|
if (!node.node_ops.setattr) {
|
||
|
throw new FS.ErrnoError(1);
|
||
|
}
|
||
|
if (FS.isDir(node.mode)) {
|
||
|
throw new FS.ErrnoError(21);
|
||
|
}
|
||
|
if (!FS.isFile(node.mode)) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
var err = FS.nodePermissions(node, "w");
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
node.node_ops.setattr(node, {
|
||
|
size: len,
|
||
|
timestamp: Date.now()
|
||
|
});
|
||
|
},
|
||
|
ftruncate: function(fd, len) {
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 0) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
FS.truncate(stream.node, len);
|
||
|
},
|
||
|
utime: function(path, atime, mtime) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: true
|
||
|
});
|
||
|
var node = lookup.node;
|
||
|
node.node_ops.setattr(node, {
|
||
|
timestamp: Math.max(atime, mtime)
|
||
|
});
|
||
|
},
|
||
|
open: function(path, flags, mode, fd_start, fd_end) {
|
||
|
if (path === "") {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
flags = typeof flags === "string" ? FS.modeStringToFlags(flags) : flags;
|
||
|
mode = typeof mode === "undefined" ? 438 : mode;
|
||
|
if (flags & 64) {
|
||
|
mode = mode & 4095 | 32768;
|
||
|
} else {
|
||
|
mode = 0;
|
||
|
}
|
||
|
var node;
|
||
|
if (typeof path === "object") {
|
||
|
node = path;
|
||
|
} else {
|
||
|
path = PATH.normalize(path);
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: !(flags & 131072)
|
||
|
});
|
||
|
node = lookup.node;
|
||
|
} catch (e) {}
|
||
|
}
|
||
|
var created = false;
|
||
|
if (flags & 64) {
|
||
|
if (node) {
|
||
|
if (flags & 128) {
|
||
|
throw new FS.ErrnoError(17);
|
||
|
}
|
||
|
} else {
|
||
|
node = FS.mknod(path, mode, 0);
|
||
|
created = true;
|
||
|
}
|
||
|
}
|
||
|
if (!node) {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
if (FS.isChrdev(node.mode)) {
|
||
|
flags &= ~512;
|
||
|
}
|
||
|
if (flags & 65536 && !FS.isDir(node.mode)) {
|
||
|
throw new FS.ErrnoError(20);
|
||
|
}
|
||
|
if (!created) {
|
||
|
var err = FS.mayOpen(node, flags);
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
}
|
||
|
if (flags & 512) {
|
||
|
FS.truncate(node, 0);
|
||
|
}
|
||
|
flags &= ~(128 | 512);
|
||
|
var stream = FS.createStream({
|
||
|
node: node,
|
||
|
path: FS.getPath(node),
|
||
|
flags: flags,
|
||
|
seekable: true,
|
||
|
position: 0,
|
||
|
stream_ops: node.stream_ops,
|
||
|
ungotten: [],
|
||
|
error: false
|
||
|
}, fd_start, fd_end);
|
||
|
if (stream.stream_ops.open) {
|
||
|
stream.stream_ops.open(stream);
|
||
|
}
|
||
|
if (Module["logReadFiles"] && !(flags & 1)) {
|
||
|
if (!FS.readFiles) FS.readFiles = {};
|
||
|
if (!(path in FS.readFiles)) {
|
||
|
FS.readFiles[path] = 1;
|
||
|
console.log("FS.trackingDelegate error on read file: " + path);
|
||
|
}
|
||
|
}
|
||
|
try {
|
||
|
if (FS.trackingDelegate["onOpenFile"]) {
|
||
|
var trackingFlags = 0;
|
||
|
if ((flags & 2097155) !== 1) {
|
||
|
trackingFlags |= FS.tracking.openFlags.READ;
|
||
|
}
|
||
|
if ((flags & 2097155) !== 0) {
|
||
|
trackingFlags |= FS.tracking.openFlags.WRITE;
|
||
|
}
|
||
|
FS.trackingDelegate["onOpenFile"](path, trackingFlags);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['onOpenFile']('" + path + "', flags) threw an exception: " + e.message);
|
||
|
}
|
||
|
return stream;
|
||
|
},
|
||
|
close: function(stream) {
|
||
|
if (FS.isClosed(stream)) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if (stream.getdents) stream.getdents = null;
|
||
|
try {
|
||
|
if (stream.stream_ops.close) {
|
||
|
stream.stream_ops.close(stream);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
throw e;
|
||
|
} finally {
|
||
|
FS.closeStream(stream.fd);
|
||
|
}
|
||
|
stream.fd = null;
|
||
|
},
|
||
|
isClosed: function(stream) {
|
||
|
return stream.fd === null;
|
||
|
},
|
||
|
llseek: function(stream, offset, whence) {
|
||
|
if (FS.isClosed(stream)) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if (!stream.seekable || !stream.stream_ops.llseek) {
|
||
|
throw new FS.ErrnoError(29);
|
||
|
}
|
||
|
if (whence != 0 && whence != 1 && whence != 2) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
stream.position = stream.stream_ops.llseek(stream, offset, whence);
|
||
|
stream.ungotten = [];
|
||
|
return stream.position;
|
||
|
},
|
||
|
read: function(stream, buffer, offset, length, position) {
|
||
|
if (length < 0 || position < 0) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
if (FS.isClosed(stream)) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 1) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if (FS.isDir(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(21);
|
||
|
}
|
||
|
if (!stream.stream_ops.read) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
var seeking = typeof position !== "undefined";
|
||
|
if (!seeking) {
|
||
|
position = stream.position;
|
||
|
} else if (!stream.seekable) {
|
||
|
throw new FS.ErrnoError(29);
|
||
|
}
|
||
|
var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
|
||
|
if (!seeking) stream.position += bytesRead;
|
||
|
return bytesRead;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, position, canOwn) {
|
||
|
if (length < 0 || position < 0) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
if (FS.isClosed(stream)) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 0) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if (FS.isDir(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(21);
|
||
|
}
|
||
|
if (!stream.stream_ops.write) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
if (stream.flags & 1024) {
|
||
|
FS.llseek(stream, 0, 2);
|
||
|
}
|
||
|
var seeking = typeof position !== "undefined";
|
||
|
if (!seeking) {
|
||
|
position = stream.position;
|
||
|
} else if (!stream.seekable) {
|
||
|
throw new FS.ErrnoError(29);
|
||
|
}
|
||
|
var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
|
||
|
if (!seeking) stream.position += bytesWritten;
|
||
|
try {
|
||
|
if (stream.path && FS.trackingDelegate["onWriteToFile"]) FS.trackingDelegate["onWriteToFile"](stream.path);
|
||
|
} catch (e) {
|
||
|
console.log("FS.trackingDelegate['onWriteToFile']('" + stream.path + "') threw an exception: " + e.message);
|
||
|
}
|
||
|
return bytesWritten;
|
||
|
},
|
||
|
allocate: function(stream, offset, length) {
|
||
|
if (FS.isClosed(stream)) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if (offset < 0 || length <= 0) {
|
||
|
throw new FS.ErrnoError(22);
|
||
|
}
|
||
|
if ((stream.flags & 2097155) === 0) {
|
||
|
throw new FS.ErrnoError(9);
|
||
|
}
|
||
|
if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) {
|
||
|
throw new FS.ErrnoError(19);
|
||
|
}
|
||
|
if (!stream.stream_ops.allocate) {
|
||
|
throw new FS.ErrnoError(95);
|
||
|
}
|
||
|
stream.stream_ops.allocate(stream, offset, length);
|
||
|
},
|
||
|
mmap: function(stream, buffer, offset, length, position, prot, flags) {
|
||
|
if ((stream.flags & 2097155) === 1) {
|
||
|
throw new FS.ErrnoError(13);
|
||
|
}
|
||
|
if (!stream.stream_ops.mmap) {
|
||
|
throw new FS.ErrnoError(19);
|
||
|
}
|
||
|
return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);
|
||
|
},
|
||
|
msync: function(stream, buffer, offset, length, mmapFlags) {
|
||
|
if (!stream || !stream.stream_ops.msync) {
|
||
|
return 0;
|
||
|
}
|
||
|
return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags);
|
||
|
},
|
||
|
munmap: function(stream) {
|
||
|
return 0;
|
||
|
},
|
||
|
ioctl: function(stream, cmd, arg) {
|
||
|
if (!stream.stream_ops.ioctl) {
|
||
|
throw new FS.ErrnoError(25);
|
||
|
}
|
||
|
return stream.stream_ops.ioctl(stream, cmd, arg);
|
||
|
},
|
||
|
readFile: function(path, opts) {
|
||
|
opts = opts || {};
|
||
|
opts.flags = opts.flags || "r";
|
||
|
opts.encoding = opts.encoding || "binary";
|
||
|
if (opts.encoding !== "utf8" && opts.encoding !== "binary") {
|
||
|
throw new Error('Invalid encoding type "' + opts.encoding + '"');
|
||
|
}
|
||
|
var ret;
|
||
|
var stream = FS.open(path, opts.flags);
|
||
|
var stat = FS.stat(path);
|
||
|
var length = stat.size;
|
||
|
var buf = new Uint8Array(length);
|
||
|
FS.read(stream, buf, 0, length, 0);
|
||
|
if (opts.encoding === "utf8") {
|
||
|
ret = UTF8ArrayToString(buf, 0);
|
||
|
} else if (opts.encoding === "binary") {
|
||
|
ret = buf;
|
||
|
}
|
||
|
FS.close(stream);
|
||
|
return ret;
|
||
|
},
|
||
|
writeFile: function(path, data, opts) {
|
||
|
opts = opts || {};
|
||
|
opts.flags = opts.flags || "w";
|
||
|
var stream = FS.open(path, opts.flags, opts.mode);
|
||
|
if (typeof data === "string") {
|
||
|
var buf = new Uint8Array(lengthBytesUTF8(data) + 1);
|
||
|
var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length);
|
||
|
FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn);
|
||
|
} else if (ArrayBuffer.isView(data)) {
|
||
|
FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn);
|
||
|
} else {
|
||
|
throw new Error("Unsupported data type");
|
||
|
}
|
||
|
FS.close(stream);
|
||
|
},
|
||
|
cwd: function() {
|
||
|
return FS.currentPath;
|
||
|
},
|
||
|
chdir: function(path) {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: true
|
||
|
});
|
||
|
if (lookup.node === null) {
|
||
|
throw new FS.ErrnoError(2);
|
||
|
}
|
||
|
if (!FS.isDir(lookup.node.mode)) {
|
||
|
throw new FS.ErrnoError(20);
|
||
|
}
|
||
|
var err = FS.nodePermissions(lookup.node, "x");
|
||
|
if (err) {
|
||
|
throw new FS.ErrnoError(err);
|
||
|
}
|
||
|
FS.currentPath = lookup.path;
|
||
|
},
|
||
|
createDefaultDirectories: function() {
|
||
|
FS.mkdir("/tmp");
|
||
|
FS.mkdir("/home");
|
||
|
FS.mkdir("/home/web_user");
|
||
|
},
|
||
|
createDefaultDevices: function() {
|
||
|
FS.mkdir("/dev");
|
||
|
FS.registerDevice(FS.makedev(1, 3), {
|
||
|
read: function() {
|
||
|
return 0;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, pos) {
|
||
|
return length;
|
||
|
}
|
||
|
});
|
||
|
FS.mkdev("/dev/null", FS.makedev(1, 3));
|
||
|
TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
|
||
|
TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
|
||
|
FS.mkdev("/dev/tty", FS.makedev(5, 0));
|
||
|
FS.mkdev("/dev/tty1", FS.makedev(6, 0));
|
||
|
var random_device;
|
||
|
if (typeof crypto === "object" && typeof crypto["getRandomValues"] === "function") {
|
||
|
var randomBuffer = new Uint8Array(1);
|
||
|
random_device = function() {
|
||
|
crypto.getRandomValues(randomBuffer);
|
||
|
return randomBuffer[0];
|
||
|
};
|
||
|
} else if (ENVIRONMENT_IS_NODE) {
|
||
|
try {
|
||
|
var crypto_module = require("crypto");
|
||
|
random_device = function() {
|
||
|
return crypto_module["randomBytes"](1)[0];
|
||
|
};
|
||
|
} catch (e) {
|
||
|
random_device = function() {
|
||
|
return Math.random() * 256 | 0;
|
||
|
};
|
||
|
}
|
||
|
} else {
|
||
|
random_device = function() {
|
||
|
abort("random_device");
|
||
|
};
|
||
|
}
|
||
|
FS.createDevice("/dev", "random", random_device);
|
||
|
FS.createDevice("/dev", "urandom", random_device);
|
||
|
FS.mkdir("/dev/shm");
|
||
|
FS.mkdir("/dev/shm/tmp");
|
||
|
},
|
||
|
createSpecialDirectories: function() {
|
||
|
FS.mkdir("/proc");
|
||
|
FS.mkdir("/proc/self");
|
||
|
FS.mkdir("/proc/self/fd");
|
||
|
FS.mount({
|
||
|
mount: function() {
|
||
|
var node = FS.createNode("/proc/self", "fd", 16384 | 511, 73);
|
||
|
node.node_ops = {
|
||
|
lookup: function(parent, name) {
|
||
|
var fd = +name;
|
||
|
var stream = FS.getStream(fd);
|
||
|
if (!stream) throw new FS.ErrnoError(9);
|
||
|
var ret = {
|
||
|
parent: null,
|
||
|
mount: {
|
||
|
mountpoint: "fake"
|
||
|
},
|
||
|
node_ops: {
|
||
|
readlink: function() {
|
||
|
return stream.path;
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
ret.parent = ret;
|
||
|
return ret;
|
||
|
}
|
||
|
};
|
||
|
return node;
|
||
|
}
|
||
|
}, {}, "/proc/self/fd");
|
||
|
},
|
||
|
createStandardStreams: function() {
|
||
|
if (Module["stdin"]) {
|
||
|
FS.createDevice("/dev", "stdin", Module["stdin"]);
|
||
|
} else {
|
||
|
FS.symlink("/dev/tty", "/dev/stdin");
|
||
|
}
|
||
|
if (Module["stdout"]) {
|
||
|
FS.createDevice("/dev", "stdout", null, Module["stdout"]);
|
||
|
} else {
|
||
|
FS.symlink("/dev/tty", "/dev/stdout");
|
||
|
}
|
||
|
if (Module["stderr"]) {
|
||
|
FS.createDevice("/dev", "stderr", null, Module["stderr"]);
|
||
|
} else {
|
||
|
FS.symlink("/dev/tty1", "/dev/stderr");
|
||
|
}
|
||
|
var stdin = FS.open("/dev/stdin", "r");
|
||
|
assert(stdin.fd === 0, "invalid handle for stdin (" + stdin.fd + ")");
|
||
|
var stdout = FS.open("/dev/stdout", "w");
|
||
|
assert(stdout.fd === 1, "invalid handle for stdout (" + stdout.fd + ")");
|
||
|
var stderr = FS.open("/dev/stderr", "w");
|
||
|
assert(stderr.fd === 2, "invalid handle for stderr (" + stderr.fd + ")");
|
||
|
},
|
||
|
ensureErrnoError: function() {
|
||
|
if (FS.ErrnoError) return;
|
||
|
FS.ErrnoError = function ErrnoError(errno, node) {
|
||
|
this.node = node;
|
||
|
this.setErrno = function(errno) {
|
||
|
this.errno = errno;
|
||
|
};
|
||
|
this.setErrno(errno);
|
||
|
this.message = "FS error";
|
||
|
if (this.stack) Object.defineProperty(this, "stack", {
|
||
|
value: new Error().stack,
|
||
|
writable: true
|
||
|
});
|
||
|
};
|
||
|
FS.ErrnoError.prototype = new Error();
|
||
|
FS.ErrnoError.prototype.constructor = FS.ErrnoError;
|
||
|
[ 2 ].forEach(function(code) {
|
||
|
FS.genericErrors[code] = new FS.ErrnoError(code);
|
||
|
FS.genericErrors[code].stack = "<generic error, no stack>";
|
||
|
});
|
||
|
},
|
||
|
staticInit: function() {
|
||
|
FS.ensureErrnoError();
|
||
|
FS.nameTable = new Array(4096);
|
||
|
FS.mount(MEMFS, {}, "/");
|
||
|
FS.createDefaultDirectories();
|
||
|
FS.createDefaultDevices();
|
||
|
FS.createSpecialDirectories();
|
||
|
FS.filesystems = {
|
||
|
"MEMFS": MEMFS,
|
||
|
"IDBFS": IDBFS,
|
||
|
"NODEFS": NODEFS,
|
||
|
"WORKERFS": WORKERFS
|
||
|
};
|
||
|
},
|
||
|
init: function(input, output, error) {
|
||
|
assert(!FS.init.initialized, "FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");
|
||
|
FS.init.initialized = true;
|
||
|
FS.ensureErrnoError();
|
||
|
Module["stdin"] = input || Module["stdin"];
|
||
|
Module["stdout"] = output || Module["stdout"];
|
||
|
Module["stderr"] = error || Module["stderr"];
|
||
|
FS.createStandardStreams();
|
||
|
},
|
||
|
quit: function() {
|
||
|
FS.init.initialized = false;
|
||
|
var fflush = Module["_fflush"];
|
||
|
if (fflush) fflush(0);
|
||
|
for (var i = 0; i < FS.streams.length; i++) {
|
||
|
var stream = FS.streams[i];
|
||
|
if (!stream) {
|
||
|
continue;
|
||
|
}
|
||
|
FS.close(stream);
|
||
|
}
|
||
|
},
|
||
|
getMode: function(canRead, canWrite) {
|
||
|
var mode = 0;
|
||
|
if (canRead) mode |= 292 | 73;
|
||
|
if (canWrite) mode |= 146;
|
||
|
return mode;
|
||
|
},
|
||
|
joinPath: function(parts, forceRelative) {
|
||
|
var path = PATH.join.apply(null, parts);
|
||
|
if (forceRelative && path[0] == "/") path = path.substr(1);
|
||
|
return path;
|
||
|
},
|
||
|
absolutePath: function(relative, base) {
|
||
|
return PATH.resolve(base, relative);
|
||
|
},
|
||
|
standardizePath: function(path) {
|
||
|
return PATH.normalize(path);
|
||
|
},
|
||
|
findObject: function(path, dontResolveLastLink) {
|
||
|
var ret = FS.analyzePath(path, dontResolveLastLink);
|
||
|
if (ret.exists) {
|
||
|
return ret.object;
|
||
|
} else {
|
||
|
___setErrNo(ret.error);
|
||
|
return null;
|
||
|
}
|
||
|
},
|
||
|
analyzePath: function(path, dontResolveLastLink) {
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: !dontResolveLastLink
|
||
|
});
|
||
|
path = lookup.path;
|
||
|
} catch (e) {}
|
||
|
var ret = {
|
||
|
isRoot: false,
|
||
|
exists: false,
|
||
|
error: 0,
|
||
|
name: null,
|
||
|
path: null,
|
||
|
object: null,
|
||
|
parentExists: false,
|
||
|
parentPath: null,
|
||
|
parentObject: null
|
||
|
};
|
||
|
try {
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
parent: true
|
||
|
});
|
||
|
ret.parentExists = true;
|
||
|
ret.parentPath = lookup.path;
|
||
|
ret.parentObject = lookup.node;
|
||
|
ret.name = PATH.basename(path);
|
||
|
lookup = FS.lookupPath(path, {
|
||
|
follow: !dontResolveLastLink
|
||
|
});
|
||
|
ret.exists = true;
|
||
|
ret.path = lookup.path;
|
||
|
ret.object = lookup.node;
|
||
|
ret.name = lookup.node.name;
|
||
|
ret.isRoot = lookup.path === "/";
|
||
|
} catch (e) {
|
||
|
ret.error = e.errno;
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
createFolder: function(parent, name, canRead, canWrite) {
|
||
|
var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name);
|
||
|
var mode = FS.getMode(canRead, canWrite);
|
||
|
return FS.mkdir(path, mode);
|
||
|
},
|
||
|
createPath: function(parent, path, canRead, canWrite) {
|
||
|
parent = typeof parent === "string" ? parent : FS.getPath(parent);
|
||
|
var parts = path.split("/").reverse();
|
||
|
while (parts.length) {
|
||
|
var part = parts.pop();
|
||
|
if (!part) continue;
|
||
|
var current = PATH.join2(parent, part);
|
||
|
try {
|
||
|
FS.mkdir(current);
|
||
|
} catch (e) {}
|
||
|
parent = current;
|
||
|
}
|
||
|
return current;
|
||
|
},
|
||
|
createFile: function(parent, name, properties, canRead, canWrite) {
|
||
|
var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name);
|
||
|
var mode = FS.getMode(canRead, canWrite);
|
||
|
return FS.create(path, mode);
|
||
|
},
|
||
|
createDataFile: function(parent, name, data, canRead, canWrite, canOwn) {
|
||
|
var path = name ? PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name) : parent;
|
||
|
var mode = FS.getMode(canRead, canWrite);
|
||
|
var node = FS.create(path, mode);
|
||
|
if (data) {
|
||
|
if (typeof data === "string") {
|
||
|
var arr = new Array(data.length);
|
||
|
for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
|
||
|
data = arr;
|
||
|
}
|
||
|
FS.chmod(node, mode | 146);
|
||
|
var stream = FS.open(node, "w");
|
||
|
FS.write(stream, data, 0, data.length, 0, canOwn);
|
||
|
FS.close(stream);
|
||
|
FS.chmod(node, mode);
|
||
|
}
|
||
|
return node;
|
||
|
},
|
||
|
createDevice: function(parent, name, input, output) {
|
||
|
var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name);
|
||
|
var mode = FS.getMode(!!input, !!output);
|
||
|
if (!FS.createDevice.major) FS.createDevice.major = 64;
|
||
|
var dev = FS.makedev(FS.createDevice.major++, 0);
|
||
|
FS.registerDevice(dev, {
|
||
|
open: function(stream) {
|
||
|
stream.seekable = false;
|
||
|
},
|
||
|
close: function(stream) {
|
||
|
if (output && output.buffer && output.buffer.length) {
|
||
|
output(10);
|
||
|
}
|
||
|
},
|
||
|
read: function(stream, buffer, offset, length, pos) {
|
||
|
var bytesRead = 0;
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
var result;
|
||
|
try {
|
||
|
result = input();
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(5);
|
||
|
}
|
||
|
if (result === undefined && bytesRead === 0) {
|
||
|
throw new FS.ErrnoError(11);
|
||
|
}
|
||
|
if (result === null || result === undefined) break;
|
||
|
bytesRead++;
|
||
|
buffer[offset + i] = result;
|
||
|
}
|
||
|
if (bytesRead) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return bytesRead;
|
||
|
},
|
||
|
write: function(stream, buffer, offset, length, pos) {
|
||
|
for (var i = 0; i < length; i++) {
|
||
|
try {
|
||
|
output(buffer[offset + i]);
|
||
|
} catch (e) {
|
||
|
throw new FS.ErrnoError(5);
|
||
|
}
|
||
|
}
|
||
|
if (length) {
|
||
|
stream.node.timestamp = Date.now();
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
});
|
||
|
return FS.mkdev(path, mode, dev);
|
||
|
},
|
||
|
createLink: function(parent, name, target, canRead, canWrite) {
|
||
|
var path = PATH.join2(typeof parent === "string" ? parent : FS.getPath(parent), name);
|
||
|
return FS.symlink(target, path);
|
||
|
},
|
||
|
forceLoadFile: function(obj) {
|
||
|
if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
|
||
|
var success = true;
|
||
|
if (typeof XMLHttpRequest !== "undefined") {
|
||
|
throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
|
||
|
} else if (Module["read"]) {
|
||
|
try {
|
||
|
obj.contents = intArrayFromString(Module["read"](obj.url), true);
|
||
|
obj.usedBytes = obj.contents.length;
|
||
|
} catch (e) {
|
||
|
success = false;
|
||
|
}
|
||
|
} else {
|
||
|
throw new Error("Cannot load without read() or XMLHttpRequest.");
|
||
|
}
|
||
|
if (!success) ___setErrNo(5);
|
||
|
return success;
|
||
|
},
|
||
|
createLazyFile: function(parent, name, url, canRead, canWrite) {
|
||
|
function LazyUint8Array() {
|
||
|
this.lengthKnown = false;
|
||
|
this.chunks = [];
|
||
|
}
|
||
|
LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) {
|
||
|
if (idx > this.length - 1 || idx < 0) {
|
||
|
return undefined;
|
||
|
}
|
||
|
var chunkOffset = idx % this.chunkSize;
|
||
|
var chunkNum = idx / this.chunkSize | 0;
|
||
|
return this.getter(chunkNum)[chunkOffset];
|
||
|
};
|
||
|
LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter(getter) {
|
||
|
this.getter = getter;
|
||
|
};
|
||
|
LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() {
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open("HEAD", url, false);
|
||
|
xhr.send(null);
|
||
|
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
|
||
|
var datalength = Number(xhr.getResponseHeader("Content-length"));
|
||
|
var header;
|
||
|
var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
|
||
|
var usesGzip = (header = xhr.getResponseHeader("Content-Encoding")) && header === "gzip";
|
||
|
var chunkSize = 1024 * 1024;
|
||
|
if (!hasByteServing) chunkSize = datalength;
|
||
|
var doXHR = function(from, to) {
|
||
|
if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
|
||
|
if (to > datalength - 1) throw new Error("only " + datalength + " bytes available! programmer error!");
|
||
|
var xhr = new XMLHttpRequest();
|
||
|
xhr.open("GET", url, false);
|
||
|
if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
|
||
|
if (typeof Uint8Array != "undefined") xhr.responseType = "arraybuffer";
|
||
|
if (xhr.overrideMimeType) {
|
||
|
xhr.overrideMimeType("text/plain; charset=x-user-defined");
|
||
|
}
|
||
|
xhr.send(null);
|
||
|
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
|
||
|
if (xhr.response !== undefined) {
|
||
|
return new Uint8Array(xhr.response || []);
|
||
|
} else {
|
||
|
return intArrayFromString(xhr.responseText || "", true);
|
||
|
}
|
||
|
};
|
||
|
var lazyArray = this;
|
||
|
lazyArray.setDataGetter(function(chunkNum) {
|
||
|
var start = chunkNum * chunkSize;
|
||
|
var end = (chunkNum + 1) * chunkSize - 1;
|
||
|
end = Math.min(end, datalength - 1);
|
||
|
if (typeof lazyArray.chunks[chunkNum] === "undefined") {
|
||
|
lazyArray.chunks[chunkNum] = doXHR(start, end);
|
||
|
}
|
||
|
if (typeof lazyArray.chunks[chunkNum] === "undefined") throw new Error("doXHR failed!");
|
||
|
return lazyArray.chunks[chunkNum];
|
||
|
});
|
||
|
if (usesGzip || !datalength) {
|
||
|
chunkSize = datalength = 1;
|
||
|
datalength = this.getter(0).length;
|
||
|
chunkSize = datalength;
|
||
|
console.log("LazyFiles on gzip forces download of the whole file when length is accessed");
|
||
|
}
|
||
|
this._length = datalength;
|
||
|
this._chunkSize = chunkSize;
|
||
|
this.lengthKnown = true;
|
||
|
};
|
||
|
if (typeof XMLHttpRequest !== "undefined") {
|
||
|
if (!ENVIRONMENT_IS_WORKER) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
|
||
|
var lazyArray = new LazyUint8Array();
|
||
|
Object.defineProperties(lazyArray, {
|
||
|
length: {
|
||
|
get: function() {
|
||
|
if (!this.lengthKnown) {
|
||
|
this.cacheLength();
|
||
|
}
|
||
|
return this._length;
|
||
|
}
|
||
|
},
|
||
|
chunkSize: {
|
||
|
get: function() {
|
||
|
if (!this.lengthKnown) {
|
||
|
this.cacheLength();
|
||
|
}
|
||
|
return this._chunkSize;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
var properties = {
|
||
|
isDevice: false,
|
||
|
contents: lazyArray
|
||
|
};
|
||
|
} else {
|
||
|
var properties = {
|
||
|
isDevice: false,
|
||
|
url: url
|
||
|
};
|
||
|
}
|
||
|
var node = FS.createFile(parent, name, properties, canRead, canWrite);
|
||
|
if (properties.contents) {
|
||
|
node.contents = properties.contents;
|
||
|
} else if (properties.url) {
|
||
|
node.contents = null;
|
||
|
node.url = properties.url;
|
||
|
}
|
||
|
Object.defineProperties(node, {
|
||
|
usedBytes: {
|
||
|
get: function() {
|
||
|
return this.contents.length;
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
var stream_ops = {};
|
||
|
var keys = Object.keys(node.stream_ops);
|
||
|
keys.forEach(function(key) {
|
||
|
var fn = node.stream_ops[key];
|
||
|
stream_ops[key] = function forceLoadLazyFile() {
|
||
|
if (!FS.forceLoadFile(node)) {
|
||
|
throw new FS.ErrnoError(5);
|
||
|
}
|
||
|
return fn.apply(null, arguments);
|
||
|
};
|
||
|
});
|
||
|
stream_ops.read = function stream_ops_read(stream, buffer, offset, length, position) {
|
||
|
if (!FS.forceLoadFile(node)) {
|
||
|
throw new FS.ErrnoError(5);
|
||
|
}
|
||
|
var contents = stream.node.contents;
|
||
|
if (position >= contents.length) return 0;
|
||
|
var size = Math.min(contents.length - position, length);
|
||
|
assert(size >= 0);
|
||
|
if (contents.slice) {
|
||
|
for (var i = 0; i < size; i++) {
|
||
|
buffer[offset + i] = contents[position + i];
|
||
|
}
|
||
|
} else {
|
||
|
for (var i = 0; i < size; i++) {
|
||
|
buffer[offset + i] = contents.get(position + i);
|
||
|
}
|
||
|
}
|
||
|
return size;
|
||
|
};
|
||
|
node.stream_ops = stream_ops;
|
||
|
return node;
|
||
|
},
|
||
|
createPreloadedFile: function(parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) {
|
||
|
Browser.init();
|
||
|
var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;
|
||
|
var dep = getUniqueRunDependency("cp " + fullname);
|
||
|
function processData(byteArray) {
|
||
|
function finish(byteArray) {
|
||
|
if (preFinish) preFinish();
|
||
|
if (!dontCreateFile) {
|
||
|
FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
|
||
|
}
|
||
|
if (onload) onload();
|
||
|
removeRunDependency(dep);
|
||
|
}
|
||
|
var handled = false;
|
||
|
Module["preloadPlugins"].forEach(function(plugin) {
|
||
|
if (handled) return;
|
||
|
if (plugin["canHandle"](fullname)) {
|
||
|
plugin["handle"](byteArray, fullname, finish, function() {
|
||
|
if (onerror) onerror();
|
||
|
removeRunDependency(dep);
|
||
|
});
|
||
|
handled = true;
|
||
|
}
|
||
|
});
|
||
|
if (!handled) finish(byteArray);
|
||
|
}
|
||
|
addRunDependency(dep);
|
||
|
if (typeof url == "string") {
|
||
|
Browser.asyncLoad(url, function(byteArray) {
|
||
|
processData(byteArray);
|
||
|
}, onerror);
|
||
|
} else {
|
||
|
processData(url);
|
||
|
}
|
||
|
},
|
||
|
indexedDB: function() {
|
||
|
return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
|
||
|
},
|
||
|
DB_NAME: function() {
|
||
|
return "EM_FS_" + window.location.pathname;
|
||
|
},
|
||
|
DB_VERSION: 20,
|
||
|
DB_STORE_NAME: "FILE_DATA",
|
||
|
saveFilesToDB: function(paths, onload, onerror) {
|
||
|
onload = onload || function() {};
|
||
|
onerror = onerror || function() {};
|
||
|
var indexedDB = FS.indexedDB();
|
||
|
try {
|
||
|
var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
|
||
|
} catch (e) {
|
||
|
return onerror(e);
|
||
|
}
|
||
|
openRequest.onupgradeneeded = function openRequest_onupgradeneeded() {
|
||
|
console.log("creating db");
|
||
|
var db = openRequest.result;
|
||
|
db.createObjectStore(FS.DB_STORE_NAME);
|
||
|
};
|
||
|
openRequest.onsuccess = function openRequest_onsuccess() {
|
||
|
var db = openRequest.result;
|
||
|
var transaction = db.transaction([ FS.DB_STORE_NAME ], "readwrite");
|
||
|
var files = transaction.objectStore(FS.DB_STORE_NAME);
|
||
|
var ok = 0, fail = 0, total = paths.length;
|
||
|
function finish() {
|
||
|
if (fail == 0) onload(); else onerror();
|
||
|
}
|
||
|
paths.forEach(function(path) {
|
||
|
var putRequest = files.put(FS.analyzePath(path).object.contents, path);
|
||
|
putRequest.onsuccess = function putRequest_onsuccess() {
|
||
|
ok++;
|
||
|
if (ok + fail == total) finish();
|
||
|
};
|
||
|
putRequest.onerror = function putRequest_onerror() {
|
||
|
fail++;
|
||
|
if (ok + fail == total) finish();
|
||
|
};
|
||
|
});
|
||
|
transaction.onerror = onerror;
|
||
|
};
|
||
|
openRequest.onerror = onerror;
|
||
|
},
|
||
|
loadFilesFromDB: function(paths, onload, onerror) {
|
||
|
onload = onload || function() {};
|
||
|
onerror = onerror || function() {};
|
||
|
var indexedDB = FS.indexedDB();
|
||
|
try {
|
||
|
var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
|
||
|
} catch (e) {
|
||
|
return onerror(e);
|
||
|
}
|
||
|
openRequest.onupgradeneeded = onerror;
|
||
|
openRequest.onsuccess = function openRequest_onsuccess() {
|
||
|
var db = openRequest.result;
|
||
|
try {
|
||
|
var transaction = db.transaction([ FS.DB_STORE_NAME ], "readonly");
|
||
|
} catch (e) {
|
||
|
onerror(e);
|
||
|
return;
|
||
|
}
|
||
|
var files = transaction.objectStore(FS.DB_STORE_NAME);
|
||
|
var ok = 0, fail = 0, total = paths.length;
|
||
|
function finish() {
|
||
|
if (fail == 0) onload(); else onerror();
|
||
|
}
|
||
|
paths.forEach(function(path) {
|
||
|
var getRequest = files.get(path);
|
||
|
getRequest.onsuccess = function getRequest_onsuccess() {
|
||
|
if (FS.analyzePath(path).exists) {
|
||
|
FS.unlink(path);
|
||
|
}
|
||
|
FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
|
||
|
ok++;
|
||
|
if (ok + fail == total) finish();
|
||
|
};
|
||
|
getRequest.onerror = function getRequest_onerror() {
|
||
|
fail++;
|
||
|
if (ok + fail == total) finish();
|
||
|
};
|
||
|
});
|
||
|
transaction.onerror = onerror;
|
||
|
};
|
||
|
openRequest.onerror = onerror;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function _emscripten_set_main_loop_timing(mode, value) {
|
||
|
Browser.mainLoop.timingMode = mode;
|
||
|
Browser.mainLoop.timingValue = value;
|
||
|
if (!Browser.mainLoop.func) {
|
||
|
return 1;
|
||
|
}
|
||
|
if (mode == 0) {
|
||
|
Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setTimeout() {
|
||
|
var timeUntilNextTick = Math.max(0, Browser.mainLoop.tickStartTime + value - _emscripten_get_now()) | 0;
|
||
|
setTimeout(Browser.mainLoop.runner, timeUntilNextTick);
|
||
|
};
|
||
|
Browser.mainLoop.method = "timeout";
|
||
|
} else if (mode == 1) {
|
||
|
Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_rAF() {
|
||
|
Browser.requestAnimationFrame(Browser.mainLoop.runner);
|
||
|
};
|
||
|
Browser.mainLoop.method = "rAF";
|
||
|
} else if (mode == 2) {
|
||
|
if (typeof setImmediate === "undefined") {
|
||
|
var setImmediates = [];
|
||
|
var emscriptenMainLoopMessageId = "setimmediate";
|
||
|
var Browser_setImmediate_messageHandler = function(event) {
|
||
|
if (event.data === emscriptenMainLoopMessageId || event.data.target === emscriptenMainLoopMessageId) {
|
||
|
event.stopPropagation();
|
||
|
setImmediates.shift()();
|
||
|
}
|
||
|
};
|
||
|
addEventListener("message", Browser_setImmediate_messageHandler, true);
|
||
|
setImmediate = function Browser_emulated_setImmediate(func) {
|
||
|
setImmediates.push(func);
|
||
|
if (ENVIRONMENT_IS_WORKER) {
|
||
|
if (Module["setImmediates"] === undefined) Module["setImmediates"] = [];
|
||
|
Module["setImmediates"].push(func);
|
||
|
postMessage({
|
||
|
target: emscriptenMainLoopMessageId
|
||
|
});
|
||
|
} else postMessage(emscriptenMainLoopMessageId, "*");
|
||
|
};
|
||
|
}
|
||
|
Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setImmediate() {
|
||
|
setImmediate(Browser.mainLoop.runner);
|
||
|
};
|
||
|
Browser.mainLoop.method = "immediate";
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
function _emscripten_get_now() {
|
||
|
abort();
|
||
|
}
|
||
|
|
||
|
function _emscripten_set_main_loop(func, fps, simulateInfiniteLoop, arg, noSetTiming) {
|
||
|
Module["noExitRuntime"] = true;
|
||
|
assert(!Browser.mainLoop.func, "emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.");
|
||
|
Browser.mainLoop.func = func;
|
||
|
Browser.mainLoop.arg = arg;
|
||
|
var browserIterationFunc;
|
||
|
if (typeof arg !== "undefined") {
|
||
|
browserIterationFunc = function() {
|
||
|
Module["dynCall_vi"](func, arg);
|
||
|
};
|
||
|
} else {
|
||
|
browserIterationFunc = function() {
|
||
|
Module["dynCall_v"](func);
|
||
|
};
|
||
|
}
|
||
|
var thisMainLoopId = Browser.mainLoop.currentlyRunningMainloop;
|
||
|
Browser.mainLoop.runner = function Browser_mainLoop_runner() {
|
||
|
if (ABORT) return;
|
||
|
if (Browser.mainLoop.queue.length > 0) {
|
||
|
var start = Date.now();
|
||
|
var blocker = Browser.mainLoop.queue.shift();
|
||
|
blocker.func(blocker.arg);
|
||
|
if (Browser.mainLoop.remainingBlockers) {
|
||
|
var remaining = Browser.mainLoop.remainingBlockers;
|
||
|
var next = remaining % 1 == 0 ? remaining - 1 : Math.floor(remaining);
|
||
|
if (blocker.counted) {
|
||
|
Browser.mainLoop.remainingBlockers = next;
|
||
|
} else {
|
||
|
next = next + .5;
|
||
|
Browser.mainLoop.remainingBlockers = (8 * remaining + next) / 9;
|
||
|
}
|
||
|
}
|
||
|
console.log('main loop blocker "' + blocker.name + '" took ' + (Date.now() - start) + " ms");
|
||
|
Browser.mainLoop.updateStatus();
|
||
|
if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
|
||
|
setTimeout(Browser.mainLoop.runner, 0);
|
||
|
return;
|
||
|
}
|
||
|
if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
|
||
|
Browser.mainLoop.currentFrameNumber = Browser.mainLoop.currentFrameNumber + 1 | 0;
|
||
|
if (Browser.mainLoop.timingMode == 1 && Browser.mainLoop.timingValue > 1 && Browser.mainLoop.currentFrameNumber % Browser.mainLoop.timingValue != 0) {
|
||
|
Browser.mainLoop.scheduler();
|
||
|
return;
|
||
|
} else if (Browser.mainLoop.timingMode == 0) {
|
||
|
Browser.mainLoop.tickStartTime = _emscripten_get_now();
|
||
|
}
|
||
|
if (Browser.mainLoop.method === "timeout" && Module.ctx) {
|
||
|
err("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!");
|
||
|
Browser.mainLoop.method = "";
|
||
|
}
|
||
|
Browser.mainLoop.runIter(browserIterationFunc);
|
||
|
if (thisMainLoopId < Browser.mainLoop.currentlyRunningMainloop) return;
|
||
|
if (typeof SDL === "object" && SDL.audio && SDL.audio.queueNewAudioData) SDL.audio.queueNewAudioData();
|
||
|
Browser.mainLoop.scheduler();
|
||
|
};
|
||
|
if (!noSetTiming) {
|
||
|
if (fps && fps > 0) _emscripten_set_main_loop_timing(0, 1e3 / fps); else _emscripten_set_main_loop_timing(1, 1);
|
||
|
Browser.mainLoop.scheduler();
|
||
|
}
|
||
|
if (simulateInfiniteLoop) {
|
||
|
throw "SimulateInfiniteLoop";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var Browser = {
|
||
|
mainLoop: {
|
||
|
scheduler: null,
|
||
|
method: "",
|
||
|
currentlyRunningMainloop: 0,
|
||
|
func: null,
|
||
|
arg: 0,
|
||
|
timingMode: 0,
|
||
|
timingValue: 0,
|
||
|
currentFrameNumber: 0,
|
||
|
queue: [],
|
||
|
pause: function() {
|
||
|
Browser.mainLoop.scheduler = null;
|
||
|
Browser.mainLoop.currentlyRunningMainloop++;
|
||
|
},
|
||
|
resume: function() {
|
||
|
Browser.mainLoop.currentlyRunningMainloop++;
|
||
|
var timingMode = Browser.mainLoop.timingMode;
|
||
|
var timingValue = Browser.mainLoop.timingValue;
|
||
|
var func = Browser.mainLoop.func;
|
||
|
Browser.mainLoop.func = null;
|
||
|
_emscripten_set_main_loop(func, 0, false, Browser.mainLoop.arg, true);
|
||
|
_emscripten_set_main_loop_timing(timingMode, timingValue);
|
||
|
Browser.mainLoop.scheduler();
|
||
|
},
|
||
|
updateStatus: function() {
|
||
|
if (Module["setStatus"]) {
|
||
|
var message = Module["statusMessage"] || "Please wait...";
|
||
|
var remaining = Browser.mainLoop.remainingBlockers;
|
||
|
var expected = Browser.mainLoop.expectedBlockers;
|
||
|
if (remaining) {
|
||
|
if (remaining < expected) {
|
||
|
Module["setStatus"](message + " (" + (expected - remaining) + "/" + expected + ")");
|
||
|
} else {
|
||
|
Module["setStatus"](message);
|
||
|
}
|
||
|
} else {
|
||
|
Module["setStatus"]("");
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
runIter: function(func) {
|
||
|
if (ABORT) return;
|
||
|
if (Module["preMainLoop"]) {
|
||
|
var preRet = Module["preMainLoop"]();
|
||
|
if (preRet === false) {
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
try {
|
||
|
func();
|
||
|
} catch (e) {
|
||
|
if (e instanceof ExitStatus) {
|
||
|
return;
|
||
|
} else {
|
||
|
if (e && typeof e === "object" && e.stack) err("exception thrown: " + [ e, e.stack ]);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
if (Module["postMainLoop"]) Module["postMainLoop"]();
|
||
|
}
|
||
|
},
|
||
|
isFullscreen: false,
|
||
|
pointerLock: false,
|
||
|
moduleContextCreatedCallbacks: [],
|
||
|
workers: [],
|
||
|
init: function() {
|
||
|
if (!Module["preloadPlugins"]) Module["preloadPlugins"] = [];
|
||
|
if (Browser.initted) return;
|
||
|
Browser.initted = true;
|
||
|
try {
|
||
|
new Blob();
|
||
|
Browser.hasBlobConstructor = true;
|
||
|
} catch (e) {
|
||
|
Browser.hasBlobConstructor = false;
|
||
|
console.log("warning: no blob constructor, cannot create blobs with mimetypes");
|
||
|
}
|
||
|
Browser.BlobBuilder = typeof MozBlobBuilder != "undefined" ? MozBlobBuilder : typeof WebKitBlobBuilder != "undefined" ? WebKitBlobBuilder : !Browser.hasBlobConstructor ? console.log("warning: no BlobBuilder") : null;
|
||
|
Browser.URLObject = typeof window != "undefined" ? window.URL ? window.URL : window.webkitURL : undefined;
|
||
|
if (!Module.noImageDecoding && typeof Browser.URLObject === "undefined") {
|
||
|
console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");
|
||
|
Module.noImageDecoding = true;
|
||
|
}
|
||
|
var imagePlugin = {};
|
||
|
imagePlugin["canHandle"] = function imagePlugin_canHandle(name) {
|
||
|
return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/i.test(name);
|
||
|
};
|
||
|
imagePlugin["handle"] = function imagePlugin_handle(byteArray, name, onload, onerror) {
|
||
|
var b = null;
|
||
|
if (Browser.hasBlobConstructor) {
|
||
|
try {
|
||
|
b = new Blob([ byteArray ], {
|
||
|
type: Browser.getMimetype(name)
|
||
|
});
|
||
|
if (b.size !== byteArray.length) {
|
||
|
b = new Blob([ new Uint8Array(byteArray).buffer ], {
|
||
|
type: Browser.getMimetype(name)
|
||
|
});
|
||
|
}
|
||
|
} catch (e) {
|
||
|
warnOnce("Blob constructor present but fails: " + e + "; falling back to blob builder");
|
||
|
}
|
||
|
}
|
||
|
if (!b) {
|
||
|
var bb = new Browser.BlobBuilder();
|
||
|
bb.append(new Uint8Array(byteArray).buffer);
|
||
|
b = bb.getBlob();
|
||
|
}
|
||
|
var url = Browser.URLObject.createObjectURL(b);
|
||
|
var img = new Image();
|
||
|
img.onload = function img_onload() {
|
||
|
assert(img.complete, "Image " + name + " could not be decoded");
|
||
|
var canvas = document.createElement("canvas");
|
||
|
canvas.width = img.width;
|
||
|
canvas.height = img.height;
|
||
|
var ctx = canvas.getContext("2d");
|
||
|
ctx.drawImage(img, 0, 0);
|
||
|
Module["preloadedImages"][name] = canvas;
|
||
|
Browser.URLObject.revokeObjectURL(url);
|
||
|
if (onload) onload(byteArray);
|
||
|
};
|
||
|
img.onerror = function img_onerror(event) {
|
||
|
console.log("Image " + url + " could not be decoded");
|
||
|
if (onerror) onerror();
|
||
|
};
|
||
|
img.src = url;
|
||
|
};
|
||
|
Module["preloadPlugins"].push(imagePlugin);
|
||
|
var audioPlugin = {};
|
||
|
audioPlugin["canHandle"] = function audioPlugin_canHandle(name) {
|
||
|
return !Module.noAudioDecoding && name.substr(-4) in {
|
||
|
".ogg": 1,
|
||
|
".wav": 1,
|
||
|
".mp3": 1
|
||
|
};
|
||
|
};
|
||
|
audioPlugin["handle"] = function audioPlugin_handle(byteArray, name, onload, onerror) {
|
||
|
var done = false;
|
||
|
function finish(audio) {
|
||
|
if (done) return;
|
||
|
done = true;
|
||
|
Module["preloadedAudios"][name] = audio;
|
||
|
if (onload) onload(byteArray);
|
||
|
}
|
||
|
function fail() {
|
||
|
if (done) return;
|
||
|
done = true;
|
||
|
Module["preloadedAudios"][name] = new Audio();
|
||
|
if (onerror) onerror();
|
||
|
}
|
||
|
if (Browser.hasBlobConstructor) {
|
||
|
try {
|
||
|
var b = new Blob([ byteArray ], {
|
||
|
type: Browser.getMimetype(name)
|
||
|
});
|
||
|
} catch (e) {
|
||
|
return fail();
|
||
|
}
|
||
|
var url = Browser.URLObject.createObjectURL(b);
|
||
|
var audio = new Audio();
|
||
|
audio.addEventListener("canplaythrough", function() {
|
||
|
finish(audio);
|
||
|
}, false);
|
||
|
audio.onerror = function audio_onerror(event) {
|
||
|
if (done) return;
|
||
|
console.log("warning: browser could not fully decode audio " + name + ", trying slower base64 approach");
|
||
|
function encode64(data) {
|
||
|
var BASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||
|
var PAD = "=";
|
||
|
var ret = "";
|
||
|
var leftchar = 0;
|
||
|
var leftbits = 0;
|
||
|
for (var i = 0; i < data.length; i++) {
|
||
|
leftchar = leftchar << 8 | data[i];
|
||
|
leftbits += 8;
|
||
|
while (leftbits >= 6) {
|
||
|
var curr = leftchar >> leftbits - 6 & 63;
|
||
|
leftbits -= 6;
|
||
|
ret += BASE[curr];
|
||
|
}
|
||
|
}
|
||
|
if (leftbits == 2) {
|
||
|
ret += BASE[(leftchar & 3) << 4];
|
||
|
ret += PAD + PAD;
|
||
|
} else if (leftbits == 4) {
|
||
|
ret += BASE[(leftchar & 15) << 2];
|
||
|
ret += PAD;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
audio.src = "data:audio/x-" + name.substr(-3) + ";base64," + encode64(byteArray);
|
||
|
finish(audio);
|
||
|
};
|
||
|
audio.src = url;
|
||
|
Browser.safeSetTimeout(function() {
|
||
|
finish(audio);
|
||
|
}, 1e4);
|
||
|
} else {
|
||
|
return fail();
|
||
|
}
|
||
|
};
|
||
|
Module["preloadPlugins"].push(audioPlugin);
|
||
|
function pointerLockChange() {
|
||
|
Browser.pointerLock = document["pointerLockElement"] === Module["canvas"] || document["mozPointerLockElement"] === Module["canvas"] || document["webkitPointerLockElement"] === Module["canvas"] || document["msPointerLockElement"] === Module["canvas"];
|
||
|
}
|
||
|
var canvas = Module["canvas"];
|
||
|
if (canvas) {
|
||
|
canvas.requestPointerLock = canvas["requestPointerLock"] || canvas["mozRequestPointerLock"] || canvas["webkitRequestPointerLock"] || canvas["msRequestPointerLock"] || function() {};
|
||
|
canvas.exitPointerLock = document["exitPointerLock"] || document["mozExitPointerLock"] || document["webkitExitPointerLock"] || document["msExitPointerLock"] || function() {};
|
||
|
canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
|
||
|
document.addEventListener("pointerlockchange", pointerLockChange, false);
|
||
|
document.addEventListener("mozpointerlockchange", pointerLockChange, false);
|
||
|
document.addEventListener("webkitpointerlockchange", pointerLockChange, false);
|
||
|
document.addEventListener("mspointerlockchange", pointerLockChange, false);
|
||
|
if (Module["elementPointerLock"]) {
|
||
|
canvas.addEventListener("click", function(ev) {
|
||
|
if (!Browser.pointerLock && Module["canvas"].requestPointerLock) {
|
||
|
Module["canvas"].requestPointerLock();
|
||
|
ev.preventDefault();
|
||
|
}
|
||
|
}, false);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
createContext: function(canvas, useWebGL, setInModule, webGLContextAttributes) {
|
||
|
if (useWebGL && Module.ctx && canvas == Module.canvas) return Module.ctx;
|
||
|
var ctx;
|
||
|
var contextHandle;
|
||
|
if (useWebGL) {
|
||
|
var contextAttributes = {
|
||
|
antialias: false,
|
||
|
alpha: false,
|
||
|
majorVersion: 1
|
||
|
};
|
||
|
if (webGLContextAttributes) {
|
||
|
for (var attribute in webGLContextAttributes) {
|
||
|
contextAttributes[attribute] = webGLContextAttributes[attribute];
|
||
|
}
|
||
|
}
|
||
|
if (typeof GL !== "undefined") {
|
||
|
contextHandle = GL.createContext(canvas, contextAttributes);
|
||
|
if (contextHandle) {
|
||
|
ctx = GL.getContext(contextHandle).GLctx;
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
ctx = canvas.getContext("2d");
|
||
|
}
|
||
|
if (!ctx) return null;
|
||
|
if (setInModule) {
|
||
|
if (!useWebGL) assert(typeof GLctx === "undefined", "cannot set in module if GLctx is used, but we are a non-GL context that would replace it");
|
||
|
Module.ctx = ctx;
|
||
|
if (useWebGL) GL.makeContextCurrent(contextHandle);
|
||
|
Module.useWebGL = useWebGL;
|
||
|
Browser.moduleContextCreatedCallbacks.forEach(function(callback) {
|
||
|
callback();
|
||
|
});
|
||
|
Browser.init();
|
||
|
}
|
||
|
return ctx;
|
||
|
},
|
||
|
destroyContext: function(canvas, useWebGL, setInModule) {},
|
||
|
fullscreenHandlersInstalled: false,
|
||
|
lockPointer: undefined,
|
||
|
resizeCanvas: undefined,
|
||
|
requestFullscreen: function(lockPointer, resizeCanvas, vrDevice) {
|
||
|
lockPointer = false;
|
||
|
console.log("forcing lockPointer to false");
|
||
|
Browser.lockPointer = lockPointer;
|
||
|
Browser.resizeCanvas = resizeCanvas;
|
||
|
Browser.vrDevice = vrDevice;
|
||
|
if (typeof Browser.lockPointer === "undefined") Browser.lockPointer = false;
|
||
|
if (typeof Browser.resizeCanvas === "undefined") Browser.resizeCanvas = false;
|
||
|
if (typeof Browser.vrDevice === "undefined") Browser.vrDevice = null;
|
||
|
var canvas = Module["canvas"];
|
||
|
function fullscreenChange() {
|
||
|
Browser.isFullscreen = false;
|
||
|
var canvasContainer = canvas.parentNode;
|
||
|
if ((document["fullscreenElement"] || document["mozFullScreenElement"] || document["msFullscreenElement"] || document["webkitFullscreenElement"] || document["webkitCurrentFullScreenElement"]) === canvasContainer) {
|
||
|
canvas.exitFullscreen = document["exitFullscreen"] || document["cancelFullScreen"] || document["mozCancelFullScreen"] || document["msExitFullscreen"] || document["webkitCancelFullScreen"] || function() {};
|
||
|
canvas.exitFullscreen = canvas.exitFullscreen.bind(document);
|
||
|
Browser.isFullscreen = true;
|
||
|
if (Browser.resizeCanvas) {
|
||
|
Browser.setFullscreenCanvasSize();
|
||
|
} else {
|
||
|
Browser.updateCanvasDimensions(canvas);
|
||
|
}
|
||
|
} else {
|
||
|
canvasContainer.parentNode.insertBefore(canvas, canvasContainer);
|
||
|
canvasContainer.parentNode.removeChild(canvasContainer);
|
||
|
if (Browser.resizeCanvas) {
|
||
|
Browser.setWindowedCanvasSize();
|
||
|
} else {
|
||
|
Browser.updateCanvasDimensions(canvas);
|
||
|
}
|
||
|
}
|
||
|
if (Module["onFullScreen"]) Module["onFullScreen"](Browser.isFullscreen);
|
||
|
if (Module["onFullscreen"]) Module["onFullscreen"](Browser.isFullscreen);
|
||
|
}
|
||
|
if (!Browser.fullscreenHandlersInstalled) {
|
||
|
Browser.fullscreenHandlersInstalled = true;
|
||
|
document.addEventListener("fullscreenchange", fullscreenChange, false);
|
||
|
document.addEventListener("mozfullscreenchange", fullscreenChange, false);
|
||
|
document.addEventListener("webkitfullscreenchange", fullscreenChange, false);
|
||
|
document.addEventListener("MSFullscreenChange", fullscreenChange, false);
|
||
|
}
|
||
|
var canvasContainer = document.createElement("div");
|
||
|
canvas.parentNode.insertBefore(canvasContainer, canvas);
|
||
|
canvasContainer.appendChild(canvas);
|
||
|
canvasContainer.requestFullscreen = canvasContainer["requestFullscreen"] || canvasContainer["mozRequestFullScreen"] || canvasContainer["msRequestFullscreen"] || (canvasContainer["webkitRequestFullscreen"] ? function() {
|
||
|
canvasContainer["webkitRequestFullscreen"](Element["ALLOW_KEYBOARD_INPUT"]);
|
||
|
} : null) || (canvasContainer["webkitRequestFullScreen"] ? function() {
|
||
|
canvasContainer["webkitRequestFullScreen"](Element["ALLOW_KEYBOARD_INPUT"]);
|
||
|
} : null);
|
||
|
if (vrDevice) {
|
||
|
canvasContainer.requestFullscreen({
|
||
|
vrDisplay: vrDevice
|
||
|
});
|
||
|
} else {
|
||
|
canvasContainer.requestFullscreen();
|
||
|
}
|
||
|
},
|
||
|
requestFullScreen: function(lockPointer, resizeCanvas, vrDevice) {
|
||
|
err("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.");
|
||
|
Browser.requestFullScreen = function(lockPointer, resizeCanvas, vrDevice) {
|
||
|
return Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
|
||
|
};
|
||
|
return Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
|
||
|
},
|
||
|
nextRAF: 0,
|
||
|
fakeRequestAnimationFrame: function(func) {
|
||
|
var now = Date.now();
|
||
|
if (Browser.nextRAF === 0) {
|
||
|
Browser.nextRAF = now + 1e3 / 60;
|
||
|
} else {
|
||
|
while (now + 2 >= Browser.nextRAF) {
|
||
|
Browser.nextRAF += 1e3 / 60;
|
||
|
}
|
||
|
}
|
||
|
var delay = Math.max(Browser.nextRAF - now, 0);
|
||
|
setTimeout(func, delay);
|
||
|
},
|
||
|
requestAnimationFrame: function requestAnimationFrame(func) {
|
||
|
if (typeof window === "undefined") {
|
||
|
Browser.fakeRequestAnimationFrame(func);
|
||
|
} else {
|
||
|
if (!window.requestAnimationFrame) {
|
||
|
window.requestAnimationFrame = window["requestAnimationFrame"] || window["mozRequestAnimationFrame"] || window["webkitRequestAnimationFrame"] || window["msRequestAnimationFrame"] || window["oRequestAnimationFrame"] || Browser.fakeRequestAnimationFrame;
|
||
|
}
|
||
|
window.requestAnimationFrame(func);
|
||
|
}
|
||
|
},
|
||
|
safeCallback: function(func) {
|
||
|
return function() {
|
||
|
if (!ABORT) return func.apply(null, arguments);
|
||
|
};
|
||
|
},
|
||
|
allowAsyncCallbacks: true,
|
||
|
queuedAsyncCallbacks: [],
|
||
|
pauseAsyncCallbacks: function() {
|
||
|
Browser.allowAsyncCallbacks = false;
|
||
|
},
|
||
|
resumeAsyncCallbacks: function() {
|
||
|
Browser.allowAsyncCallbacks = true;
|
||
|
if (Browser.queuedAsyncCallbacks.length > 0) {
|
||
|
var callbacks = Browser.queuedAsyncCallbacks;
|
||
|
Browser.queuedAsyncCallbacks = [];
|
||
|
callbacks.forEach(function(func) {
|
||
|
func();
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
safeRequestAnimationFrame: function(func) {
|
||
|
return Browser.requestAnimationFrame(function() {
|
||
|
if (ABORT) return;
|
||
|
if (Browser.allowAsyncCallbacks) {
|
||
|
func();
|
||
|
} else {
|
||
|
Browser.queuedAsyncCallbacks.push(func);
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
safeSetTimeout: function(func, timeout) {
|
||
|
Module["noExitRuntime"] = true;
|
||
|
return setTimeout(function() {
|
||
|
if (ABORT) return;
|
||
|
if (Browser.allowAsyncCallbacks) {
|
||
|
func();
|
||
|
} else {
|
||
|
Browser.queuedAsyncCallbacks.push(func);
|
||
|
}
|
||
|
}, timeout);
|
||
|
},
|
||
|
safeSetInterval: function(func, timeout) {
|
||
|
Module["noExitRuntime"] = true;
|
||
|
return setInterval(function() {
|
||
|
if (ABORT) return;
|
||
|
if (Browser.allowAsyncCallbacks) {
|
||
|
func();
|
||
|
}
|
||
|
}, timeout);
|
||
|
},
|
||
|
getMimetype: function(name) {
|
||
|
return {
|
||
|
"jpg": "image/jpeg",
|
||
|
"jpeg": "image/jpeg",
|
||
|
"png": "image/png",
|
||
|
"bmp": "image/bmp",
|
||
|
"ogg": "audio/ogg",
|
||
|
"wav": "audio/wav",
|
||
|
"mp3": "audio/mpeg"
|
||
|
}[name.substr(name.lastIndexOf(".") + 1)];
|
||
|
},
|
||
|
getUserMedia: function(func) {
|
||
|
if (!window.getUserMedia) {
|
||
|
window.getUserMedia = navigator["getUserMedia"] || navigator["mozGetUserMedia"];
|
||
|
}
|
||
|
window.getUserMedia(func);
|
||
|
},
|
||
|
getMovementX: function(event) {
|
||
|
return event["movementX"] || event["mozMovementX"] || event["webkitMovementX"] || 0;
|
||
|
},
|
||
|
getMovementY: function(event) {
|
||
|
return event["movementY"] || event["mozMovementY"] || event["webkitMovementY"] || 0;
|
||
|
},
|
||
|
getMouseWheelDelta: function(event) {
|
||
|
var delta = 0;
|
||
|
switch (event.type) {
|
||
|
case "DOMMouseScroll":
|
||
|
delta = event.detail;
|
||
|
break;
|
||
|
|
||
|
case "mousewheel":
|
||
|
delta = event.wheelDelta;
|
||
|
break;
|
||
|
|
||
|
case "wheel":
|
||
|
delta = event["deltaY"];
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
throw "unrecognized mouse wheel event: " + event.type;
|
||
|
}
|
||
|
return delta;
|
||
|
},
|
||
|
mouseX: 0,
|
||
|
mouseY: 0,
|
||
|
mouseMovementX: 0,
|
||
|
mouseMovementY: 0,
|
||
|
touches: {},
|
||
|
lastTouches: {},
|
||
|
calculateMouseEvent: function(event) {
|
||
|
if (Browser.pointerLock) {
|
||
|
if (event.type != "mousemove" && "mozMovementX" in event) {
|
||
|
Browser.mouseMovementX = Browser.mouseMovementY = 0;
|
||
|
} else {
|
||
|
Browser.mouseMovementX = Browser.getMovementX(event);
|
||
|
Browser.mouseMovementY = Browser.getMovementY(event);
|
||
|
}
|
||
|
if (typeof SDL != "undefined") {
|
||
|
Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
|
||
|
Browser.mouseY = SDL.mouseY + Browser.mouseMovementY;
|
||
|
} else {
|
||
|
Browser.mouseX += Browser.mouseMovementX;
|
||
|
Browser.mouseY += Browser.mouseMovementY;
|
||
|
}
|
||
|
} else {
|
||
|
var rect = Module["canvas"].getBoundingClientRect();
|
||
|
var cw = Module["canvas"].width;
|
||
|
var ch = Module["canvas"].height;
|
||
|
var scrollX = typeof window.scrollX !== "undefined" ? window.scrollX : window.pageXOffset;
|
||
|
var scrollY = typeof window.scrollY !== "undefined" ? window.scrollY : window.pageYOffset;
|
||
|
if (event.type === "touchstart" || event.type === "touchend" || event.type === "touchmove") {
|
||
|
var touch = event.touch;
|
||
|
if (touch === undefined) {
|
||
|
return;
|
||
|
}
|
||
|
var adjustedX = touch.pageX - (scrollX + rect.left);
|
||
|
var adjustedY = touch.pageY - (scrollY + rect.top);
|
||
|
adjustedX = adjustedX * (cw / rect.width);
|
||
|
adjustedY = adjustedY * (ch / rect.height);
|
||
|
var coords = {
|
||
|
x: adjustedX,
|
||
|
y: adjustedY
|
||
|
};
|
||
|
if (event.type === "touchstart") {
|
||
|
Browser.lastTouches[touch.identifier] = coords;
|
||
|
Browser.touches[touch.identifier] = coords;
|
||
|
} else if (event.type === "touchend" || event.type === "touchmove") {
|
||
|
var last = Browser.touches[touch.identifier];
|
||
|
if (!last) last = coords;
|
||
|
Browser.lastTouches[touch.identifier] = last;
|
||
|
Browser.touches[touch.identifier] = coords;
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
var x = event.pageX - (scrollX + rect.left);
|
||
|
var y = event.pageY - (scrollY + rect.top);
|
||
|
x = x * (cw / rect.width);
|
||
|
y = y * (ch / rect.height);
|
||
|
Browser.mouseMovementX = x - Browser.mouseX;
|
||
|
Browser.mouseMovementY = y - Browser.mouseY;
|
||
|
Browser.mouseX = x;
|
||
|
Browser.mouseY = y;
|
||
|
}
|
||
|
},
|
||
|
asyncLoad: function(url, onload, onerror, noRunDep) {
|
||
|
var dep = !noRunDep ? getUniqueRunDependency("al " + url) : "";
|
||
|
Module["readAsync"](url, function(arrayBuffer) {
|
||
|
assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).');
|
||
|
onload(new Uint8Array(arrayBuffer));
|
||
|
if (dep) removeRunDependency(dep);
|
||
|
}, function(event) {
|
||
|
if (onerror) {
|
||
|
onerror();
|
||
|
} else {
|
||
|
throw 'Loading data file "' + url + '" failed.';
|
||
|
}
|
||
|
});
|
||
|
if (dep) addRunDependency(dep);
|
||
|
},
|
||
|
resizeListeners: [],
|
||
|
updateResizeListeners: function() {
|
||
|
var canvas = Module["canvas"];
|
||
|
Browser.resizeListeners.forEach(function(listener) {
|
||
|
listener(canvas.width, canvas.height);
|
||
|
});
|
||
|
},
|
||
|
setCanvasSize: function(width, height, noUpdates) {
|
||
|
var canvas = Module["canvas"];
|
||
|
Browser.updateCanvasDimensions(canvas, width, height);
|
||
|
if (!noUpdates) Browser.updateResizeListeners();
|
||
|
},
|
||
|
windowedWidth: 0,
|
||
|
windowedHeight: 0,
|
||
|
setFullscreenCanvasSize: function() {
|
||
|
if (typeof SDL != "undefined") {
|
||
|
var flags = HEAPU32[SDL.screen >> 2];
|
||
|
flags = flags | 8388608;
|
||
|
HEAP32[SDL.screen >> 2] = flags;
|
||
|
}
|
||
|
Browser.updateCanvasDimensions(Module["canvas"]);
|
||
|
Browser.updateResizeListeners();
|
||
|
},
|
||
|
setWindowedCanvasSize: function() {
|
||
|
if (typeof SDL != "undefined") {
|
||
|
var flags = HEAPU32[SDL.screen >> 2];
|
||
|
flags = flags & ~8388608;
|
||
|
HEAP32[SDL.screen >> 2] = flags;
|
||
|
}
|
||
|
Browser.updateCanvasDimensions(Module["canvas"]);
|
||
|
Browser.updateResizeListeners();
|
||
|
},
|
||
|
updateCanvasDimensions: function(canvas, wNative, hNative) {
|
||
|
if (wNative && hNative) {
|
||
|
canvas.widthNative = wNative;
|
||
|
canvas.heightNative = hNative;
|
||
|
} else {
|
||
|
wNative = canvas.widthNative;
|
||
|
hNative = canvas.heightNative;
|
||
|
}
|
||
|
var w = wNative;
|
||
|
var h = hNative;
|
||
|
if (Module["forcedAspectRatio"] && Module["forcedAspectRatio"] > 0) {
|
||
|
if (w / h < Module["forcedAspectRatio"]) {
|
||
|
w = Math.round(h * Module["forcedAspectRatio"]);
|
||
|
} else {
|
||
|
h = Math.round(w / Module["forcedAspectRatio"]);
|
||
|
}
|
||
|
}
|
||
|
if ((document["fullscreenElement"] || document["mozFullScreenElement"] || document["msFullscreenElement"] || document["webkitFullscreenElement"] || document["webkitCurrentFullScreenElement"]) === canvas.parentNode && typeof screen != "undefined") {
|
||
|
var factor = Math.min(screen.width / w, screen.height / h);
|
||
|
w = Math.round(w * factor);
|
||
|
h = Math.round(h * factor);
|
||
|
}
|
||
|
if (Browser.resizeCanvas) {
|
||
|
if (canvas.width != w) canvas.width = w;
|
||
|
if (canvas.height != h) canvas.height = h;
|
||
|
if (typeof canvas.style != "undefined") {
|
||
|
canvas.style.removeProperty("width");
|
||
|
canvas.style.removeProperty("height");
|
||
|
}
|
||
|
} else {
|
||
|
if (canvas.width != wNative) canvas.width = wNative;
|
||
|
if (canvas.height != hNative) canvas.height = hNative;
|
||
|
if (typeof canvas.style != "undefined") {
|
||
|
if (w != wNative || h != hNative) {
|
||
|
canvas.style.setProperty("width", w + "px", "important");
|
||
|
canvas.style.setProperty("height", h + "px", "important");
|
||
|
} else {
|
||
|
canvas.style.removeProperty("width");
|
||
|
canvas.style.removeProperty("height");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
wgetRequests: {},
|
||
|
nextWgetRequestHandle: 0,
|
||
|
getNextWgetRequestHandle: function() {
|
||
|
var handle = Browser.nextWgetRequestHandle;
|
||
|
Browser.nextWgetRequestHandle++;
|
||
|
return handle;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function _SDL_GetTicks() {
|
||
|
return Date.now() - SDL.startTime | 0;
|
||
|
}
|
||
|
|
||
|
function _SDL_LockSurface(surf) {
|
||
|
var surfData = SDL.surfaces[surf];
|
||
|
surfData.locked++;
|
||
|
if (surfData.locked > 1) return 0;
|
||
|
if (!surfData.buffer) {
|
||
|
surfData.buffer = _malloc(surfData.width * surfData.height * 4);
|
||
|
HEAP32[surf + 20 >> 2] = surfData.buffer;
|
||
|
}
|
||
|
HEAP32[surf + 20 >> 2] = surfData.buffer;
|
||
|
if (surf == SDL.screen && Module.screenIsReadOnly && surfData.image) return 0;
|
||
|
if (SDL.defaults.discardOnLock) {
|
||
|
if (!surfData.image) {
|
||
|
surfData.image = surfData.ctx.createImageData(surfData.width, surfData.height);
|
||
|
}
|
||
|
if (!SDL.defaults.opaqueFrontBuffer) return;
|
||
|
} else {
|
||
|
surfData.image = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
|
||
|
}
|
||
|
if (surf == SDL.screen && SDL.defaults.opaqueFrontBuffer) {
|
||
|
var data = surfData.image.data;
|
||
|
var num = data.length;
|
||
|
for (var i = 0; i < num / 4; i++) {
|
||
|
data[i * 4 + 3] = 255;
|
||
|
}
|
||
|
}
|
||
|
if (SDL.defaults.copyOnLock && !SDL.defaults.discardOnLock) {
|
||
|
if (surfData.isFlagSet(2097152)) {
|
||
|
throw "CopyOnLock is not supported for SDL_LockSurface with SDL_HWPALETTE flag set" + new Error().stack;
|
||
|
} else {
|
||
|
HEAPU8.set(surfData.image.data, surfData.buffer);
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
var SDL = {
|
||
|
defaults: {
|
||
|
width: 320,
|
||
|
height: 200,
|
||
|
copyOnLock: false,
|
||
|
discardOnLock: true,
|
||
|
opaqueFrontBuffer: false
|
||
|
},
|
||
|
version: null,
|
||
|
surfaces: {},
|
||
|
canvasPool: [],
|
||
|
events: [],
|
||
|
fonts: [ null ],
|
||
|
audios: [ null ],
|
||
|
rwops: [ null ],
|
||
|
music: {
|
||
|
audio: null,
|
||
|
volume: 1
|
||
|
},
|
||
|
mixerFrequency: 22050,
|
||
|
mixerFormat: 32784,
|
||
|
mixerNumChannels: 2,
|
||
|
mixerChunkSize: 1024,
|
||
|
channelMinimumNumber: 0,
|
||
|
GL: false,
|
||
|
glAttributes: {
|
||
|
0: 3,
|
||
|
1: 3,
|
||
|
2: 2,
|
||
|
3: 0,
|
||
|
4: 0,
|
||
|
5: 1,
|
||
|
6: 16,
|
||
|
7: 0,
|
||
|
8: 0,
|
||
|
9: 0,
|
||
|
10: 0,
|
||
|
11: 0,
|
||
|
12: 0,
|
||
|
13: 0,
|
||
|
14: 0,
|
||
|
15: 1,
|
||
|
16: 0,
|
||
|
17: 0,
|
||
|
18: 0
|
||
|
},
|
||
|
keyboardState: null,
|
||
|
keyboardMap: {},
|
||
|
canRequestFullscreen: false,
|
||
|
isRequestingFullscreen: false,
|
||
|
textInput: false,
|
||
|
startTime: null,
|
||
|
initFlags: 0,
|
||
|
buttonState: 0,
|
||
|
modState: 0,
|
||
|
DOMButtons: [ 0, 0, 0 ],
|
||
|
DOMEventToSDLEvent: {},
|
||
|
TOUCH_DEFAULT_ID: 0,
|
||
|
eventHandler: null,
|
||
|
eventHandlerContext: null,
|
||
|
eventHandlerTemp: 0,
|
||
|
keyCodes: {
|
||
|
16: 1249,
|
||
|
17: 1248,
|
||
|
18: 1250,
|
||
|
20: 1081,
|
||
|
33: 1099,
|
||
|
34: 1102,
|
||
|
35: 1101,
|
||
|
36: 1098,
|
||
|
37: 1104,
|
||
|
38: 1106,
|
||
|
39: 1103,
|
||
|
40: 1105,
|
||
|
44: 316,
|
||
|
45: 1097,
|
||
|
46: 127,
|
||
|
91: 1251,
|
||
|
93: 1125,
|
||
|
96: 1122,
|
||
|
97: 1113,
|
||
|
98: 1114,
|
||
|
99: 1115,
|
||
|
100: 1116,
|
||
|
101: 1117,
|
||
|
102: 1118,
|
||
|
103: 1119,
|
||
|
104: 1120,
|
||
|
105: 1121,
|
||
|
106: 1109,
|
||
|
107: 1111,
|
||
|
109: 1110,
|
||
|
110: 1123,
|
||
|
111: 1108,
|
||
|
112: 1082,
|
||
|
113: 1083,
|
||
|
114: 1084,
|
||
|
115: 1085,
|
||
|
116: 1086,
|
||
|
117: 1087,
|
||
|
118: 1088,
|
||
|
119: 1089,
|
||
|
120: 1090,
|
||
|
121: 1091,
|
||
|
122: 1092,
|
||
|
123: 1093,
|
||
|
124: 1128,
|
||
|
125: 1129,
|
||
|
126: 1130,
|
||
|
127: 1131,
|
||
|
128: 1132,
|
||
|
129: 1133,
|
||
|
130: 1134,
|
||
|
131: 1135,
|
||
|
132: 1136,
|
||
|
133: 1137,
|
||
|
134: 1138,
|
||
|
135: 1139,
|
||
|
144: 1107,
|
||
|
160: 94,
|
||
|
161: 33,
|
||
|
162: 34,
|
||
|
163: 35,
|
||
|
164: 36,
|
||
|
165: 37,
|
||
|
166: 38,
|
||
|
167: 95,
|
||
|
168: 40,
|
||
|
169: 41,
|
||
|
170: 42,
|
||
|
171: 43,
|
||
|
172: 124,
|
||
|
173: 45,
|
||
|
174: 123,
|
||
|
175: 125,
|
||
|
176: 126,
|
||
|
181: 127,
|
||
|
182: 129,
|
||
|
183: 128,
|
||
|
188: 44,
|
||
|
190: 46,
|
||
|
191: 47,
|
||
|
192: 96,
|
||
|
219: 91,
|
||
|
220: 92,
|
||
|
221: 93,
|
||
|
222: 39,
|
||
|
224: 1251
|
||
|
},
|
||
|
scanCodes: {
|
||
|
8: 42,
|
||
|
9: 43,
|
||
|
13: 40,
|
||
|
27: 41,
|
||
|
32: 44,
|
||
|
35: 204,
|
||
|
39: 53,
|
||
|
44: 54,
|
||
|
46: 55,
|
||
|
47: 56,
|
||
|
48: 39,
|
||
|
49: 30,
|
||
|
50: 31,
|
||
|
51: 32,
|
||
|
52: 33,
|
||
|
53: 34,
|
||
|
54: 35,
|
||
|
55: 36,
|
||
|
56: 37,
|
||
|
57: 38,
|
||
|
58: 203,
|
||
|
59: 51,
|
||
|
61: 46,
|
||
|
91: 47,
|
||
|
92: 49,
|
||
|
93: 48,
|
||
|
96: 52,
|
||
|
97: 4,
|
||
|
98: 5,
|
||
|
99: 6,
|
||
|
100: 7,
|
||
|
101: 8,
|
||
|
102: 9,
|
||
|
103: 10,
|
||
|
104: 11,
|
||
|
105: 12,
|
||
|
106: 13,
|
||
|
107: 14,
|
||
|
108: 15,
|
||
|
109: 16,
|
||
|
110: 17,
|
||
|
111: 18,
|
||
|
112: 19,
|
||
|
113: 20,
|
||
|
114: 21,
|
||
|
115: 22,
|
||
|
116: 23,
|
||
|
117: 24,
|
||
|
118: 25,
|
||
|
119: 26,
|
||
|
120: 27,
|
||
|
121: 28,
|
||
|
122: 29,
|
||
|
127: 76,
|
||
|
305: 224,
|
||
|
308: 226,
|
||
|
316: 70
|
||
|
},
|
||
|
loadRect: function(rect) {
|
||
|
return {
|
||
|
x: HEAP32[rect + 0 >> 2],
|
||
|
y: HEAP32[rect + 4 >> 2],
|
||
|
w: HEAP32[rect + 8 >> 2],
|
||
|
h: HEAP32[rect + 12 >> 2]
|
||
|
};
|
||
|
},
|
||
|
updateRect: function(rect, r) {
|
||
|
HEAP32[rect >> 2] = r.x;
|
||
|
HEAP32[rect + 4 >> 2] = r.y;
|
||
|
HEAP32[rect + 8 >> 2] = r.w;
|
||
|
HEAP32[rect + 12 >> 2] = r.h;
|
||
|
},
|
||
|
intersectionOfRects: function(first, second) {
|
||
|
var leftX = Math.max(first.x, second.x);
|
||
|
var leftY = Math.max(first.y, second.y);
|
||
|
var rightX = Math.min(first.x + first.w, second.x + second.w);
|
||
|
var rightY = Math.min(first.y + first.h, second.y + second.h);
|
||
|
return {
|
||
|
x: leftX,
|
||
|
y: leftY,
|
||
|
w: Math.max(leftX, rightX) - leftX,
|
||
|
h: Math.max(leftY, rightY) - leftY
|
||
|
};
|
||
|
},
|
||
|
checkPixelFormat: function(fmt) {},
|
||
|
loadColorToCSSRGB: function(color) {
|
||
|
var rgba = HEAP32[color >> 2];
|
||
|
return "rgb(" + (rgba & 255) + "," + (rgba >> 8 & 255) + "," + (rgba >> 16 & 255) + ")";
|
||
|
},
|
||
|
loadColorToCSSRGBA: function(color) {
|
||
|
var rgba = HEAP32[color >> 2];
|
||
|
return "rgba(" + (rgba & 255) + "," + (rgba >> 8 & 255) + "," + (rgba >> 16 & 255) + "," + (rgba >> 24 & 255) / 255 + ")";
|
||
|
},
|
||
|
translateColorToCSSRGBA: function(rgba) {
|
||
|
return "rgba(" + (rgba & 255) + "," + (rgba >> 8 & 255) + "," + (rgba >> 16 & 255) + "," + (rgba >>> 24) / 255 + ")";
|
||
|
},
|
||
|
translateRGBAToCSSRGBA: function(r, g, b, a) {
|
||
|
return "rgba(" + (r & 255) + "," + (g & 255) + "," + (b & 255) + "," + (a & 255) / 255 + ")";
|
||
|
},
|
||
|
translateRGBAToColor: function(r, g, b, a) {
|
||
|
return r | g << 8 | b << 16 | a << 24;
|
||
|
},
|
||
|
makeSurface: function(width, height, flags, usePageCanvas, source, rmask, gmask, bmask, amask) {
|
||
|
flags = flags || 0;
|
||
|
var is_SDL_HWSURFACE = flags & 1;
|
||
|
var is_SDL_HWPALETTE = flags & 2097152;
|
||
|
var is_SDL_OPENGL = flags & 67108864;
|
||
|
var surf = _malloc(60);
|
||
|
var pixelFormat = _malloc(44);
|
||
|
var bpp = is_SDL_HWPALETTE ? 1 : 4;
|
||
|
var buffer = 0;
|
||
|
if (!is_SDL_HWSURFACE && !is_SDL_OPENGL) {
|
||
|
buffer = _malloc(width * height * 4);
|
||
|
}
|
||
|
HEAP32[surf >> 2] = flags;
|
||
|
HEAP32[surf + 4 >> 2] = pixelFormat;
|
||
|
HEAP32[surf + 8 >> 2] = width;
|
||
|
HEAP32[surf + 12 >> 2] = height;
|
||
|
HEAP32[surf + 16 >> 2] = width * bpp;
|
||
|
HEAP32[surf + 20 >> 2] = buffer;
|
||
|
HEAP32[surf + 36 >> 2] = 0;
|
||
|
HEAP32[surf + 40 >> 2] = 0;
|
||
|
HEAP32[surf + 44 >> 2] = Module["canvas"].width;
|
||
|
HEAP32[surf + 48 >> 2] = Module["canvas"].height;
|
||
|
HEAP32[surf + 56 >> 2] = 1;
|
||
|
HEAP32[pixelFormat >> 2] = -2042224636;
|
||
|
HEAP32[pixelFormat + 4 >> 2] = 0;
|
||
|
HEAP8[pixelFormat + 8 >> 0] = bpp * 8;
|
||
|
HEAP8[pixelFormat + 9 >> 0] = bpp;
|
||
|
HEAP32[pixelFormat + 12 >> 2] = rmask || 255;
|
||
|
HEAP32[pixelFormat + 16 >> 2] = gmask || 65280;
|
||
|
HEAP32[pixelFormat + 20 >> 2] = bmask || 16711680;
|
||
|
HEAP32[pixelFormat + 24 >> 2] = amask || 4278190080;
|
||
|
SDL.GL = SDL.GL || is_SDL_OPENGL;
|
||
|
var canvas;
|
||
|
if (!usePageCanvas) {
|
||
|
if (SDL.canvasPool.length > 0) {
|
||
|
canvas = SDL.canvasPool.pop();
|
||
|
} else {
|
||
|
canvas = document.createElement("canvas");
|
||
|
}
|
||
|
canvas.width = width;
|
||
|
canvas.height = height;
|
||
|
} else {
|
||
|
canvas = Module["canvas"];
|
||
|
}
|
||
|
var webGLContextAttributes = {
|
||
|
antialias: SDL.glAttributes[13] != 0 && SDL.glAttributes[14] > 1,
|
||
|
depth: SDL.glAttributes[6] > 0,
|
||
|
stencil: SDL.glAttributes[7] > 0,
|
||
|
alpha: SDL.glAttributes[3] > 0
|
||
|
};
|
||
|
var ctx = Browser.createContext(canvas, is_SDL_OPENGL, usePageCanvas, webGLContextAttributes);
|
||
|
SDL.surfaces[surf] = {
|
||
|
width: width,
|
||
|
height: height,
|
||
|
canvas: canvas,
|
||
|
ctx: ctx,
|
||
|
surf: surf,
|
||
|
buffer: buffer,
|
||
|
pixelFormat: pixelFormat,
|
||
|
alpha: 255,
|
||
|
flags: flags,
|
||
|
locked: 0,
|
||
|
usePageCanvas: usePageCanvas,
|
||
|
source: source,
|
||
|
isFlagSet: function(flag) {
|
||
|
return flags & flag;
|
||
|
}
|
||
|
};
|
||
|
return surf;
|
||
|
},
|
||
|
copyIndexedColorData: function(surfData, rX, rY, rW, rH) {
|
||
|
if (!surfData.colors) {
|
||
|
return;
|
||
|
}
|
||
|
var fullWidth = Module["canvas"].width;
|
||
|
var fullHeight = Module["canvas"].height;
|
||
|
var startX = rX || 0;
|
||
|
var startY = rY || 0;
|
||
|
var endX = (rW || fullWidth - startX) + startX;
|
||
|
var endY = (rH || fullHeight - startY) + startY;
|
||
|
var buffer = surfData.buffer;
|
||
|
if (!surfData.image.data32) {
|
||
|
surfData.image.data32 = new Uint32Array(surfData.image.data.buffer);
|
||
|
}
|
||
|
var data32 = surfData.image.data32;
|
||
|
var colors32 = surfData.colors32;
|
||
|
for (var y = startY; y < endY; ++y) {
|
||
|
var base = y * fullWidth;
|
||
|
for (var x = startX; x < endX; ++x) {
|
||
|
data32[base + x] = colors32[HEAPU8[buffer + base + x >> 0]];
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
freeSurface: function(surf) {
|
||
|
var refcountPointer = surf + 56;
|
||
|
var refcount = HEAP32[refcountPointer >> 2];
|
||
|
if (refcount > 1) {
|
||
|
HEAP32[refcountPointer >> 2] = refcount - 1;
|
||
|
return;
|
||
|
}
|
||
|
var info = SDL.surfaces[surf];
|
||
|
if (!info.usePageCanvas && info.canvas) SDL.canvasPool.push(info.canvas);
|
||
|
if (info.buffer) _free(info.buffer);
|
||
|
_free(info.pixelFormat);
|
||
|
_free(surf);
|
||
|
SDL.surfaces[surf] = null;
|
||
|
if (surf === SDL.screen) {
|
||
|
SDL.screen = null;
|
||
|
}
|
||
|
},
|
||
|
blitSurface: function(src, srcrect, dst, dstrect, scale) {
|
||
|
var srcData = SDL.surfaces[src];
|
||
|
var dstData = SDL.surfaces[dst];
|
||
|
var sr, dr;
|
||
|
if (srcrect) {
|
||
|
sr = SDL.loadRect(srcrect);
|
||
|
} else {
|
||
|
sr = {
|
||
|
x: 0,
|
||
|
y: 0,
|
||
|
w: srcData.width,
|
||
|
h: srcData.height
|
||
|
};
|
||
|
}
|
||
|
if (dstrect) {
|
||
|
dr = SDL.loadRect(dstrect);
|
||
|
} else {
|
||
|
dr = {
|
||
|
x: 0,
|
||
|
y: 0,
|
||
|
w: srcData.width,
|
||
|
h: srcData.height
|
||
|
};
|
||
|
}
|
||
|
if (dstData.clipRect) {
|
||
|
var widthScale = !scale || sr.w === 0 ? 1 : sr.w / dr.w;
|
||
|
var heightScale = !scale || sr.h === 0 ? 1 : sr.h / dr.h;
|
||
|
dr = SDL.intersectionOfRects(dstData.clipRect, dr);
|
||
|
sr.w = dr.w * widthScale;
|
||
|
sr.h = dr.h * heightScale;
|
||
|
if (dstrect) {
|
||
|
SDL.updateRect(dstrect, dr);
|
||
|
}
|
||
|
}
|
||
|
var blitw, blith;
|
||
|
if (scale) {
|
||
|
blitw = dr.w;
|
||
|
blith = dr.h;
|
||
|
} else {
|
||
|
blitw = sr.w;
|
||
|
blith = sr.h;
|
||
|
}
|
||
|
if (sr.w === 0 || sr.h === 0 || blitw === 0 || blith === 0) {
|
||
|
return 0;
|
||
|
}
|
||
|
var oldAlpha = dstData.ctx.globalAlpha;
|
||
|
dstData.ctx.globalAlpha = srcData.alpha / 255;
|
||
|
dstData.ctx.drawImage(srcData.canvas, sr.x, sr.y, sr.w, sr.h, dr.x, dr.y, blitw, blith);
|
||
|
dstData.ctx.globalAlpha = oldAlpha;
|
||
|
if (dst != SDL.screen) {
|
||
|
warnOnce("WARNING: copying canvas data to memory for compatibility");
|
||
|
_SDL_LockSurface(dst);
|
||
|
dstData.locked--;
|
||
|
}
|
||
|
return 0;
|
||
|
},
|
||
|
downFingers: {},
|
||
|
savedKeydown: null,
|
||
|
receiveEvent: function(event) {
|
||
|
function unpressAllPressedKeys() {
|
||
|
for (var code in SDL.keyboardMap) {
|
||
|
SDL.events.push({
|
||
|
type: "keyup",
|
||
|
keyCode: SDL.keyboardMap[code]
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
switch (event.type) {
|
||
|
case "touchstart":
|
||
|
case "touchmove":
|
||
|
{
|
||
|
event.preventDefault();
|
||
|
var touches = [];
|
||
|
if (event.type === "touchstart") {
|
||
|
for (var i = 0; i < event.touches.length; i++) {
|
||
|
var touch = event.touches[i];
|
||
|
if (SDL.downFingers[touch.identifier] != true) {
|
||
|
SDL.downFingers[touch.identifier] = true;
|
||
|
touches.push(touch);
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
touches = event.touches;
|
||
|
}
|
||
|
var firstTouch = touches[0];
|
||
|
if (firstTouch) {
|
||
|
if (event.type == "touchstart") {
|
||
|
SDL.DOMButtons[0] = 1;
|
||
|
}
|
||
|
var mouseEventType;
|
||
|
switch (event.type) {
|
||
|
case "touchstart":
|
||
|
mouseEventType = "mousedown";
|
||
|
break;
|
||
|
|
||
|
case "touchmove":
|
||
|
mouseEventType = "mousemove";
|
||
|
break;
|
||
|
}
|
||
|
var mouseEvent = {
|
||
|
type: mouseEventType,
|
||
|
button: 0,
|
||
|
pageX: firstTouch.clientX,
|
||
|
pageY: firstTouch.clientY
|
||
|
};
|
||
|
SDL.events.push(mouseEvent);
|
||
|
}
|
||
|
for (var i = 0; i < touches.length; i++) {
|
||
|
var touch = touches[i];
|
||
|
SDL.events.push({
|
||
|
type: event.type,
|
||
|
touch: touch
|
||
|
});
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "touchend":
|
||
|
{
|
||
|
event.preventDefault();
|
||
|
for (var i = 0; i < event.changedTouches.length; i++) {
|
||
|
var touch = event.changedTouches[i];
|
||
|
if (SDL.downFingers[touch.identifier] === true) {
|
||
|
delete SDL.downFingers[touch.identifier];
|
||
|
}
|
||
|
}
|
||
|
var mouseEvent = {
|
||
|
type: "mouseup",
|
||
|
button: 0,
|
||
|
pageX: event.changedTouches[0].clientX,
|
||
|
pageY: event.changedTouches[0].clientY
|
||
|
};
|
||
|
SDL.DOMButtons[0] = 0;
|
||
|
SDL.events.push(mouseEvent);
|
||
|
for (var i = 0; i < event.changedTouches.length; i++) {
|
||
|
var touch = event.changedTouches[i];
|
||
|
SDL.events.push({
|
||
|
type: "touchend",
|
||
|
touch: touch
|
||
|
});
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "DOMMouseScroll":
|
||
|
case "mousewheel":
|
||
|
case "wheel":
|
||
|
var delta = -Browser.getMouseWheelDelta(event);
|
||
|
delta = delta == 0 ? 0 : delta > 0 ? Math.max(delta, 1) : Math.min(delta, -1);
|
||
|
var button = delta > 0 ? 3 : 4;
|
||
|
SDL.events.push({
|
||
|
type: "mousedown",
|
||
|
button: button,
|
||
|
pageX: event.pageX,
|
||
|
pageY: event.pageY
|
||
|
});
|
||
|
SDL.events.push({
|
||
|
type: "mouseup",
|
||
|
button: button,
|
||
|
pageX: event.pageX,
|
||
|
pageY: event.pageY
|
||
|
});
|
||
|
SDL.events.push({
|
||
|
type: "wheel",
|
||
|
deltaX: 0,
|
||
|
deltaY: delta
|
||
|
});
|
||
|
event.preventDefault();
|
||
|
break;
|
||
|
|
||
|
case "mousemove":
|
||
|
if (SDL.DOMButtons[0] === 1) {
|
||
|
SDL.events.push({
|
||
|
type: "touchmove",
|
||
|
touch: {
|
||
|
identifier: 0,
|
||
|
deviceID: -1,
|
||
|
pageX: event.pageX,
|
||
|
pageY: event.pageY
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
if (Browser.pointerLock) {
|
||
|
if ("mozMovementX" in event) {
|
||
|
event["movementX"] = event["mozMovementX"];
|
||
|
event["movementY"] = event["mozMovementY"];
|
||
|
}
|
||
|
if (event["movementX"] == 0 && event["movementY"] == 0) {
|
||
|
event.preventDefault();
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
case "keydown":
|
||
|
case "keyup":
|
||
|
case "keypress":
|
||
|
case "mousedown":
|
||
|
case "mouseup":
|
||
|
if (event.type !== "keydown" || !SDL.unicode && !SDL.textInput || (event.keyCode === 8 || event.keyCode === 9)) {}
|
||
|
if (event.type == "mousedown") {
|
||
|
SDL.DOMButtons[event.button] = 1;
|
||
|
SDL.events.push({
|
||
|
type: "touchstart",
|
||
|
touch: {
|
||
|
identifier: 0,
|
||
|
deviceID: -1,
|
||
|
pageX: event.pageX,
|
||
|
pageY: event.pageY
|
||
|
}
|
||
|
});
|
||
|
} else if (event.type == "mouseup") {
|
||
|
if (!SDL.DOMButtons[event.button]) {
|
||
|
return;
|
||
|
}
|
||
|
SDL.events.push({
|
||
|
type: "touchend",
|
||
|
touch: {
|
||
|
identifier: 0,
|
||
|
deviceID: -1,
|
||
|
pageX: event.pageX,
|
||
|
pageY: event.pageY
|
||
|
}
|
||
|
});
|
||
|
SDL.DOMButtons[event.button] = 0;
|
||
|
}
|
||
|
if (event.type === "keydown" || event.type === "mousedown") {
|
||
|
SDL.canRequestFullscreen = true;
|
||
|
} else if (event.type === "keyup" || event.type === "mouseup") {
|
||
|
if (SDL.isRequestingFullscreen) {
|
||
|
Module["requestFullscreen"](false, true);
|
||
|
SDL.isRequestingFullscreen = false;
|
||
|
}
|
||
|
SDL.canRequestFullscreen = false;
|
||
|
}
|
||
|
if (event.type === "keypress" && SDL.savedKeydown) {
|
||
|
SDL.savedKeydown.keypressCharCode = event.charCode;
|
||
|
SDL.savedKeydown = null;
|
||
|
} else if (event.type === "keydown") {
|
||
|
SDL.savedKeydown = event;
|
||
|
}
|
||
|
if (event.type !== "keypress" || SDL.textInput) {
|
||
|
SDL.events.push(event);
|
||
|
}
|
||
|
break;
|
||
|
|
||
|
case "mouseout":
|
||
|
for (var i = 0; i < 3; i++) {
|
||
|
if (SDL.DOMButtons[i]) {
|
||
|
SDL.events.push({
|
||
|
type: "mouseup",
|
||
|
button: i,
|
||
|
pageX: event.pageX,
|
||
|
pageY: event.pageY
|
||
|
});
|
||
|
SDL.DOMButtons[i] = 0;
|
||
|
}
|
||
|
}
|
||
|
event.preventDefault();
|
||
|
break;
|
||
|
|
||
|
case "focus":
|
||
|
SDL.events.push(event);
|
||
|
event.preventDefault();
|
||
|
break;
|
||
|
|
||
|
case "blur":
|
||
|
SDL.events.push(event);
|
||
|
unpressAllPressedKeys();
|
||
|
event.preventDefault();
|
||
|
break;
|
||
|
|
||
|
case "visibilitychange":
|
||
|
SDL.events.push({
|
||
|
type: "visibilitychange",
|
||
|
visible: !document.hidden
|
||
|
});
|
||
|
unpressAllPressedKeys();
|
||
|
event.preventDefault();
|
||
|
break;
|
||
|
|
||
|
case "unload":
|
||
|
if (Browser.mainLoop.runner) {
|
||
|
SDL.events.push(event);
|
||
|
Browser.mainLoop.runner();
|
||
|
}
|
||
|
return;
|
||
|
|
||
|
case "resize":
|
||
|
SDL.events.push(event);
|
||
|
if (event.preventDefault) {
|
||
|
event.preventDefault();
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
if (SDL.events.length >= 1e4) {
|
||
|
err("SDL event queue full, dropping events");
|
||
|
SDL.events = SDL.events.slice(0, 1e4);
|
||
|
}
|
||
|
SDL.flushEventsToHandler();
|
||
|
return;
|
||
|
},
|
||
|
lookupKeyCodeForEvent: function(event) {
|
||
|
var code = event.keyCode;
|
||
|
if (code >= 65 && code <= 90) {
|
||
|
code += 32;
|
||
|
} else {
|
||
|
code = SDL.keyCodes[event.keyCode] || event.keyCode;
|
||
|
if (event.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT && code >= (224 | 1 << 10) && code <= (227 | 1 << 10)) {
|
||
|
code += 4;
|
||
|
}
|
||
|
}
|
||
|
return code;
|
||
|
},
|
||
|
handleEvent: function(event) {
|
||
|
if (event.handled) return;
|
||
|
event.handled = true;
|
||
|
switch (event.type) {
|
||
|
case "touchstart":
|
||
|
case "touchend":
|
||
|
case "touchmove":
|
||
|
{
|
||
|
Browser.calculateMouseEvent(event);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "keydown":
|
||
|
case "keyup":
|
||
|
{
|
||
|
var down = event.type === "keydown";
|
||
|
var code = SDL.lookupKeyCodeForEvent(event);
|
||
|
HEAP8[SDL.keyboardState + code >> 0] = down;
|
||
|
SDL.modState = (HEAP8[SDL.keyboardState + 1248 >> 0] ? 64 : 0) | (HEAP8[SDL.keyboardState + 1249 >> 0] ? 1 : 0) | (HEAP8[SDL.keyboardState + 1250 >> 0] ? 256 : 0) | (HEAP8[SDL.keyboardState + 1252 >> 0] ? 128 : 0) | (HEAP8[SDL.keyboardState + 1253 >> 0] ? 2 : 0) | (HEAP8[SDL.keyboardState + 1254 >> 0] ? 512 : 0);
|
||
|
if (down) {
|
||
|
SDL.keyboardMap[code] = event.keyCode;
|
||
|
} else {
|
||
|
delete SDL.keyboardMap[code];
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "mousedown":
|
||
|
case "mouseup":
|
||
|
if (event.type == "mousedown") {
|
||
|
SDL.buttonState |= 1 << event.button;
|
||
|
} else if (event.type == "mouseup") {
|
||
|
SDL.buttonState &= ~(1 << event.button);
|
||
|
}
|
||
|
|
||
|
case "mousemove":
|
||
|
{
|
||
|
Browser.calculateMouseEvent(event);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
flushEventsToHandler: function() {
|
||
|
if (!SDL.eventHandler) return;
|
||
|
while (SDL.pollEvent(SDL.eventHandlerTemp)) {
|
||
|
Module["dynCall_iii"](SDL.eventHandler, SDL.eventHandlerContext, SDL.eventHandlerTemp);
|
||
|
}
|
||
|
},
|
||
|
pollEvent: function(ptr) {
|
||
|
if (SDL.initFlags & 512 && SDL.joystickEventState) {
|
||
|
SDL.queryJoysticks();
|
||
|
}
|
||
|
if (ptr) {
|
||
|
while (SDL.events.length > 0) {
|
||
|
if (SDL.makeCEvent(SDL.events.shift(), ptr) !== false) return 1;
|
||
|
}
|
||
|
return 0;
|
||
|
} else {
|
||
|
return SDL.events.length > 0;
|
||
|
}
|
||
|
},
|
||
|
makeCEvent: function(event, ptr) {
|
||
|
if (typeof event === "number") {
|
||
|
_memcpy(ptr, event, 28);
|
||
|
_free(event);
|
||
|
return;
|
||
|
}
|
||
|
SDL.handleEvent(event);
|
||
|
switch (event.type) {
|
||
|
case "keydown":
|
||
|
case "keyup":
|
||
|
{
|
||
|
var down = event.type === "keydown";
|
||
|
var key = SDL.lookupKeyCodeForEvent(event);
|
||
|
var scan;
|
||
|
if (key >= 1024) {
|
||
|
scan = key - 1024;
|
||
|
} else {
|
||
|
scan = SDL.scanCodes[key] || key;
|
||
|
}
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP8[ptr + 8 >> 0] = down ? 1 : 0;
|
||
|
HEAP8[ptr + 9 >> 0] = 0;
|
||
|
HEAP32[ptr + 12 >> 2] = scan;
|
||
|
HEAP32[ptr + 16 >> 2] = key;
|
||
|
HEAP16[ptr + 20 >> 1] = SDL.modState;
|
||
|
HEAP32[ptr + 24 >> 2] = event.keypressCharCode || key;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "keypress":
|
||
|
{
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
var cStr = intArrayFromString(String.fromCharCode(event.charCode));
|
||
|
for (var i = 0; i < cStr.length; ++i) {
|
||
|
HEAP8[ptr + (8 + i) >> 0] = cStr[i];
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "mousedown":
|
||
|
case "mouseup":
|
||
|
case "mousemove":
|
||
|
{
|
||
|
if (event.type != "mousemove") {
|
||
|
var down = event.type === "mousedown";
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = 0;
|
||
|
HEAP32[ptr + 8 >> 2] = 0;
|
||
|
HEAP32[ptr + 12 >> 2] = 0;
|
||
|
HEAP8[ptr + 16 >> 0] = event.button + 1;
|
||
|
HEAP8[ptr + 17 >> 0] = down ? 1 : 0;
|
||
|
HEAP32[ptr + 20 >> 2] = Browser.mouseX;
|
||
|
HEAP32[ptr + 24 >> 2] = Browser.mouseY;
|
||
|
} else {
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = 0;
|
||
|
HEAP32[ptr + 8 >> 2] = 0;
|
||
|
HEAP32[ptr + 12 >> 2] = 0;
|
||
|
HEAP32[ptr + 16 >> 2] = SDL.buttonState;
|
||
|
HEAP32[ptr + 20 >> 2] = Browser.mouseX;
|
||
|
HEAP32[ptr + 24 >> 2] = Browser.mouseY;
|
||
|
HEAP32[ptr + 28 >> 2] = Browser.mouseMovementX;
|
||
|
HEAP32[ptr + 32 >> 2] = Browser.mouseMovementY;
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "wheel":
|
||
|
{
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 16 >> 2] = event.deltaX;
|
||
|
HEAP32[ptr + 20 >> 2] = event.deltaY;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "touchstart":
|
||
|
case "touchend":
|
||
|
case "touchmove":
|
||
|
{
|
||
|
var touch = event.touch;
|
||
|
if (!Browser.touches[touch.identifier]) break;
|
||
|
var w = Module["canvas"].width;
|
||
|
var h = Module["canvas"].height;
|
||
|
var x = Browser.touches[touch.identifier].x / w;
|
||
|
var y = Browser.touches[touch.identifier].y / h;
|
||
|
var lx = Browser.lastTouches[touch.identifier].x / w;
|
||
|
var ly = Browser.lastTouches[touch.identifier].y / h;
|
||
|
var dx = x - lx;
|
||
|
var dy = y - ly;
|
||
|
if (touch["deviceID"] === undefined) touch.deviceID = SDL.TOUCH_DEFAULT_ID;
|
||
|
if (dx === 0 && dy === 0 && event.type === "touchmove") return false;
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = _SDL_GetTicks();
|
||
|
tempI64 = [ touch.deviceID >>> 0, (tempDouble = touch.deviceID, +Math_abs(tempDouble) >= +1 ? tempDouble > +0 ? (Math_min(+Math_floor(tempDouble / +4294967296), +4294967295) | 0) >>> 0 : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / +4294967296) >>> 0 : 0) ],
|
||
|
HEAP32[ptr + 8 >> 2] = tempI64[0], HEAP32[ptr + 12 >> 2] = tempI64[1];
|
||
|
tempI64 = [ touch.identifier >>> 0, (tempDouble = touch.identifier, +Math_abs(tempDouble) >= +1 ? tempDouble > +0 ? (Math_min(+Math_floor(tempDouble / +4294967296), +4294967295) | 0) >>> 0 : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / +4294967296) >>> 0 : 0) ],
|
||
|
HEAP32[ptr + 16 >> 2] = tempI64[0], HEAP32[ptr + 20 >> 2] = tempI64[1];
|
||
|
HEAPF32[ptr + 24 >> 2] = x;
|
||
|
HEAPF32[ptr + 28 >> 2] = y;
|
||
|
HEAPF32[ptr + 32 >> 2] = dx;
|
||
|
HEAPF32[ptr + 36 >> 2] = dy;
|
||
|
if (touch.force !== undefined) {
|
||
|
HEAPF32[ptr + 40 >> 2] = touch.force;
|
||
|
} else {
|
||
|
HEAPF32[ptr + 40 >> 2] = event.type == "touchend" ? 0 : 1;
|
||
|
}
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "unload":
|
||
|
{
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "resize":
|
||
|
{
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = event.w;
|
||
|
HEAP32[ptr + 8 >> 2] = event.h;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "joystick_button_up":
|
||
|
case "joystick_button_down":
|
||
|
{
|
||
|
var state = event.type === "joystick_button_up" ? 0 : 1;
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP8[ptr + 4 >> 0] = event.index;
|
||
|
HEAP8[ptr + 5 >> 0] = event.button;
|
||
|
HEAP8[ptr + 6 >> 0] = state;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "joystick_axis_motion":
|
||
|
{
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP8[ptr + 4 >> 0] = event.index;
|
||
|
HEAP8[ptr + 5 >> 0] = event.axis;
|
||
|
HEAP32[ptr + 8 >> 2] = SDL.joystickAxisValueConversion(event.value);
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "focus":
|
||
|
{
|
||
|
var SDL_WINDOWEVENT_FOCUS_GAINED = 12;
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = 0;
|
||
|
HEAP8[ptr + 8 >> 0] = SDL_WINDOWEVENT_FOCUS_GAINED;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "blur":
|
||
|
{
|
||
|
var SDL_WINDOWEVENT_FOCUS_LOST = 13;
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = 0;
|
||
|
HEAP8[ptr + 8 >> 0] = SDL_WINDOWEVENT_FOCUS_LOST;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
case "visibilitychange":
|
||
|
{
|
||
|
var SDL_WINDOWEVENT_SHOWN = 1;
|
||
|
var SDL_WINDOWEVENT_HIDDEN = 2;
|
||
|
var visibilityEventID = event.visible ? SDL_WINDOWEVENT_SHOWN : SDL_WINDOWEVENT_HIDDEN;
|
||
|
HEAP32[ptr >> 2] = SDL.DOMEventToSDLEvent[event.type];
|
||
|
HEAP32[ptr + 4 >> 2] = 0;
|
||
|
HEAP8[ptr + 8 >> 0] = visibilityEventID;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
default:
|
||
|
throw "Unhandled SDL event: " + event.type;
|
||
|
}
|
||
|
},
|
||
|
makeFontString: function(height, fontName) {
|
||
|
if (fontName.charAt(0) != "'" && fontName.charAt(0) != '"') {
|
||
|
fontName = '"' + fontName + '"';
|
||
|
}
|
||
|
return height + "px " + fontName + ", serif";
|
||
|
},
|
||
|
estimateTextWidth: function(fontData, text) {
|
||
|
var h = fontData.size;
|
||
|
var fontString = SDL.makeFontString(h, fontData.name);
|
||
|
var tempCtx = SDL.ttfContext;
|
||
|
tempCtx.save();
|
||
|
tempCtx.font = fontString;
|
||
|
var ret = tempCtx.measureText(text).width | 0;
|
||
|
tempCtx.restore();
|
||
|
return ret;
|
||
|
},
|
||
|
allocateChannels: function(num) {
|
||
|
if (SDL.numChannels && SDL.numChannels >= num && num != 0) return;
|
||
|
SDL.numChannels = num;
|
||
|
SDL.channels = [];
|
||
|
for (var i = 0; i < num; i++) {
|
||
|
SDL.channels[i] = {
|
||
|
audio: null,
|
||
|
volume: 1
|
||
|
};
|
||
|
}
|
||
|
},
|
||
|
setGetVolume: function(info, volume) {
|
||
|
if (!info) return 0;
|
||
|
var ret = info.volume * 128;
|
||
|
if (volume != -1) {
|
||
|
info.volume = Math.min(Math.max(volume, 0), 128) / 128;
|
||
|
if (info.audio) {
|
||
|
try {
|
||
|
info.audio.volume = info.volume;
|
||
|
if (info.audio.webAudioGainNode) info.audio.webAudioGainNode["gain"]["value"] = info.volume;
|
||
|
} catch (e) {
|
||
|
err("setGetVolume failed to set audio volume: " + e);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
setPannerPosition: function(info, x, y, z) {
|
||
|
if (!info) return;
|
||
|
if (info.audio) {
|
||
|
if (info.audio.webAudioPannerNode) {
|
||
|
info.audio.webAudioPannerNode["setPosition"](x, y, z);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
playWebAudio: function(audio) {
|
||
|
if (!audio) return;
|
||
|
if (audio.webAudioNode) return;
|
||
|
if (!SDL.webAudioAvailable()) return;
|
||
|
try {
|
||
|
var webAudio = audio.resource.webAudio;
|
||
|
audio.paused = false;
|
||
|
if (!webAudio.decodedBuffer) {
|
||
|
if (webAudio.onDecodeComplete === undefined) abort("Cannot play back audio object that was not loaded");
|
||
|
webAudio.onDecodeComplete.push(function() {
|
||
|
if (!audio.paused) SDL.playWebAudio(audio);
|
||
|
});
|
||
|
return;
|
||
|
}
|
||
|
audio.webAudioNode = SDL.audioContext["createBufferSource"]();
|
||
|
audio.webAudioNode["buffer"] = webAudio.decodedBuffer;
|
||
|
audio.webAudioNode["loop"] = audio.loop;
|
||
|
audio.webAudioNode["onended"] = function() {
|
||
|
audio["onended"]();
|
||
|
};
|
||
|
audio.webAudioPannerNode = SDL.audioContext["createPanner"]();
|
||
|
audio.webAudioPannerNode["setPosition"](0, 0, -.5);
|
||
|
audio.webAudioPannerNode["panningModel"] = "equalpower";
|
||
|
audio.webAudioGainNode = SDL.audioContext["createGain"]();
|
||
|
audio.webAudioGainNode["gain"]["value"] = audio.volume;
|
||
|
audio.webAudioNode["connect"](audio.webAudioPannerNode);
|
||
|
audio.webAudioPannerNode["connect"](audio.webAudioGainNode);
|
||
|
audio.webAudioGainNode["connect"](SDL.audioContext["destination"]);
|
||
|
audio.webAudioNode["start"](0, audio.currentPosition);
|
||
|
audio.startTime = SDL.audioContext["currentTime"] - audio.currentPosition;
|
||
|
} catch (e) {
|
||
|
err("playWebAudio failed: " + e);
|
||
|
}
|
||
|
},
|
||
|
pauseWebAudio: function(audio) {
|
||
|
if (!audio) return;
|
||
|
if (audio.webAudioNode) {
|
||
|
try {
|
||
|
audio.currentPosition = (SDL.audioContext["currentTime"] - audio.startTime) % audio.resource.webAudio.decodedBuffer.duration;
|
||
|
audio.webAudioNode["onended"] = undefined;
|
||
|
audio.webAudioNode.stop(0);
|
||
|
audio.webAudioNode = undefined;
|
||
|
} catch (e) {
|
||
|
err("pauseWebAudio failed: " + e);
|
||
|
}
|
||
|
}
|
||
|
audio.paused = true;
|
||
|
},
|
||
|
openAudioContext: function() {
|
||
|
if (!SDL.audioContext) {
|
||
|
if (typeof AudioContext !== "undefined") SDL.audioContext = new AudioContext(); else if (typeof webkitAudioContext !== "undefined") SDL.audioContext = new webkitAudioContext();
|
||
|
}
|
||
|
},
|
||
|
webAudioAvailable: function() {
|
||
|
return !!SDL.audioContext;
|
||
|
},
|
||
|
fillWebAudioBufferFromHeap: function(heapPtr, sizeSamplesPerChannel, dstAudioBuffer) {
|
||
|
var numChannels = SDL.audio.channels;
|
||
|
for (var c = 0; c < numChannels; ++c) {
|
||
|
var channelData = dstAudioBuffer["getChannelData"](c);
|
||
|
if (channelData.length != sizeSamplesPerChannel) {
|
||
|
throw "Web Audio output buffer length mismatch! Destination size: " + channelData.length + " samples vs expected " + sizeSamplesPerChannel + " samples!";
|
||
|
}
|
||
|
if (SDL.audio.format == 32784) {
|
||
|
for (var j = 0; j < sizeSamplesPerChannel; ++j) {
|
||
|
channelData[j] = HEAP16[heapPtr + (j * numChannels + c) * 2 >> 1] / 32768;
|
||
|
}
|
||
|
} else if (SDL.audio.format == 8) {
|
||
|
for (var j = 0; j < sizeSamplesPerChannel; ++j) {
|
||
|
var v = HEAP8[heapPtr + (j * numChannels + c) >> 0];
|
||
|
channelData[j] = (v >= 0 ? v - 128 : v + 128) / 128;
|
||
|
}
|
||
|
} else if (SDL.audio.format == 33056) {
|
||
|
for (var j = 0; j < sizeSamplesPerChannel; ++j) {
|
||
|
channelData[j] = HEAPF32[heapPtr + (j * numChannels + c) * 4 >> 2];
|
||
|
}
|
||
|
} else {
|
||
|
throw "Invalid SDL audio format " + SDL.audio.format + "!";
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
debugSurface: function(surfData) {
|
||
|
console.log("dumping surface " + [ surfData.surf, surfData.source, surfData.width, surfData.height ]);
|
||
|
var image = surfData.ctx.getImageData(0, 0, surfData.width, surfData.height);
|
||
|
var data = image.data;
|
||
|
var num = Math.min(surfData.width, surfData.height);
|
||
|
for (var i = 0; i < num; i++) {
|
||
|
console.log(" diagonal " + i + ":" + [ data[i * surfData.width * 4 + i * 4 + 0], data[i * surfData.width * 4 + i * 4 + 1], data[i * surfData.width * 4 + i * 4 + 2], data[i * surfData.width * 4 + i * 4 + 3] ]);
|
||
|
}
|
||
|
},
|
||
|
joystickEventState: 1,
|
||
|
lastJoystickState: {},
|
||
|
joystickNamePool: {},
|
||
|
recordJoystickState: function(joystick, state) {
|
||
|
var buttons = new Array(state.buttons.length);
|
||
|
for (var i = 0; i < state.buttons.length; i++) {
|
||
|
buttons[i] = SDL.getJoystickButtonState(state.buttons[i]);
|
||
|
}
|
||
|
SDL.lastJoystickState[joystick] = {
|
||
|
buttons: buttons,
|
||
|
axes: state.axes.slice(0),
|
||
|
timestamp: state.timestamp,
|
||
|
index: state.index,
|
||
|
id: state.id
|
||
|
};
|
||
|
},
|
||
|
getJoystickButtonState: function(button) {
|
||
|
if (typeof button === "object") {
|
||
|
return button["pressed"];
|
||
|
} else {
|
||
|
return button > 0;
|
||
|
}
|
||
|
},
|
||
|
queryJoysticks: function() {
|
||
|
for (var joystick in SDL.lastJoystickState) {
|
||
|
var state = SDL.getGamepad(joystick - 1);
|
||
|
var prevState = SDL.lastJoystickState[joystick];
|
||
|
if (typeof state === "undefined") return;
|
||
|
if (state === null) return;
|
||
|
if (typeof state.timestamp !== "number" || state.timestamp !== prevState.timestamp || !state.timestamp) {
|
||
|
var i;
|
||
|
for (i = 0; i < state.buttons.length; i++) {
|
||
|
var buttonState = SDL.getJoystickButtonState(state.buttons[i]);
|
||
|
if (buttonState !== prevState.buttons[i]) {
|
||
|
SDL.events.push({
|
||
|
type: buttonState ? "joystick_button_down" : "joystick_button_up",
|
||
|
joystick: joystick,
|
||
|
index: joystick - 1,
|
||
|
button: i
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
for (i = 0; i < state.axes.length; i++) {
|
||
|
if (state.axes[i] !== prevState.axes[i]) {
|
||
|
SDL.events.push({
|
||
|
type: "joystick_axis_motion",
|
||
|
joystick: joystick,
|
||
|
index: joystick - 1,
|
||
|
axis: i,
|
||
|
value: state.axes[i]
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
SDL.recordJoystickState(joystick, state);
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
joystickAxisValueConversion: function(value) {
|
||
|
value = Math.min(1, Math.max(value, -1));
|
||
|
return Math.ceil((value + 1) * 32767.5 - 32768);
|
||
|
},
|
||
|
getGamepads: function() {
|
||
|
var fcn = navigator.getGamepads || navigator.webkitGamepads || navigator.mozGamepads || navigator.gamepads || navigator.webkitGetGamepads;
|
||
|
if (fcn !== undefined) {
|
||
|
return fcn.apply(navigator);
|
||
|
} else {
|
||
|
return [];
|
||
|
}
|
||
|
},
|
||
|
getGamepad: function(deviceIndex) {
|
||
|
var gamepads = SDL.getGamepads();
|
||
|
if (gamepads.length > deviceIndex && deviceIndex >= 0) {
|
||
|
return gamepads[deviceIndex];
|
||
|
}
|
||
|
return null;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function _SDL_ClearError() {}
|
||
|
|
||
|
function _SDL_GetError() {
|
||
|
if (!SDL.errorMessage) {
|
||
|
SDL.errorMessage = allocate(intArrayFromString("unknown SDL-emscripten error"), "i8", ALLOC_NORMAL);
|
||
|
}
|
||
|
return SDL.errorMessage;
|
||
|
}
|
||
|
|
||
|
function _SDL_GetModState() {
|
||
|
return SDL.modState;
|
||
|
}
|
||
|
|
||
|
function _SDL_GetMouseState(x, y) {
|
||
|
if (x) HEAP32[x >> 2] = Browser.mouseX;
|
||
|
if (y) HEAP32[y >> 2] = Browser.mouseY;
|
||
|
return SDL.buttonState;
|
||
|
}
|
||
|
|
||
|
function _SDL_GetWindowSize(window, width, height) {
|
||
|
var w = Module["canvas"].width;
|
||
|
var h = Module["canvas"].height;
|
||
|
if (width) HEAP32[width >> 2] = w;
|
||
|
if (height) HEAP32[height >> 2] = h;
|
||
|
}
|
||
|
|
||
|
function _SDL_Init(initFlags) {
|
||
|
SDL.startTime = Date.now();
|
||
|
SDL.initFlags = initFlags;
|
||
|
if (!Module["doNotCaptureKeyboard"]) {
|
||
|
var keyboardListeningElement = Module["keyboardListeningElement"] || document;
|
||
|
keyboardListeningElement.addEventListener("keydown", SDL.receiveEvent);
|
||
|
keyboardListeningElement.addEventListener("keyup", SDL.receiveEvent);
|
||
|
keyboardListeningElement.addEventListener("keypress", SDL.receiveEvent);
|
||
|
window.addEventListener("focus", SDL.receiveEvent);
|
||
|
window.addEventListener("blur", SDL.receiveEvent);
|
||
|
document.addEventListener("visibilitychange", SDL.receiveEvent);
|
||
|
}
|
||
|
window.addEventListener("unload", SDL.receiveEvent);
|
||
|
SDL.keyboardState = _malloc(65536);
|
||
|
_memset(SDL.keyboardState, 0, 65536);
|
||
|
SDL.DOMEventToSDLEvent["keydown"] = 768;
|
||
|
SDL.DOMEventToSDLEvent["keyup"] = 769;
|
||
|
SDL.DOMEventToSDLEvent["keypress"] = 771;
|
||
|
SDL.DOMEventToSDLEvent["mousedown"] = 1025;
|
||
|
SDL.DOMEventToSDLEvent["mouseup"] = 1026;
|
||
|
SDL.DOMEventToSDLEvent["mousemove"] = 1024;
|
||
|
SDL.DOMEventToSDLEvent["wheel"] = 1027;
|
||
|
SDL.DOMEventToSDLEvent["touchstart"] = 1792;
|
||
|
SDL.DOMEventToSDLEvent["touchend"] = 1793;
|
||
|
SDL.DOMEventToSDLEvent["touchmove"] = 1794;
|
||
|
SDL.DOMEventToSDLEvent["unload"] = 256;
|
||
|
SDL.DOMEventToSDLEvent["resize"] = 28673;
|
||
|
SDL.DOMEventToSDLEvent["visibilitychange"] = 512;
|
||
|
SDL.DOMEventToSDLEvent["focus"] = 512;
|
||
|
SDL.DOMEventToSDLEvent["blur"] = 512;
|
||
|
SDL.DOMEventToSDLEvent["joystick_axis_motion"] = 1536;
|
||
|
SDL.DOMEventToSDLEvent["joystick_button_down"] = 1539;
|
||
|
SDL.DOMEventToSDLEvent["joystick_button_up"] = 1540;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
function _SDL_LockAudio() {}
|
||
|
|
||
|
function _SDL_PollEvent(ptr) {
|
||
|
return SDL.pollEvent(ptr);
|
||
|
}
|
||
|
|
||
|
var GL = {
|
||
|
counter: 1,
|
||
|
lastError: 0,
|
||
|
buffers: [],
|
||
|
mappedBuffers: {},
|
||
|
programs: [],
|
||
|
framebuffers: [],
|
||
|
renderbuffers: [],
|
||
|
textures: [],
|
||
|
uniforms: [],
|
||
|
shaders: [],
|
||
|
vaos: [],
|
||
|
contexts: {},
|
||
|
currentContext: null,
|
||
|
offscreenCanvases: {},
|
||
|
timerQueriesEXT: [],
|
||
|
programInfos: {},
|
||
|
stringCache: {},
|
||
|
unpackAlignment: 4,
|
||
|
init: function() {
|
||
|
GL.miniTempBuffer = new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);
|
||
|
for (var i = 0; i < GL.MINI_TEMP_BUFFER_SIZE; i++) {
|
||
|
GL.miniTempBufferViews[i] = GL.miniTempBuffer.subarray(0, i + 1);
|
||
|
}
|
||
|
},
|
||
|
recordError: function recordError(errorCode) {
|
||
|
if (!GL.lastError) {
|
||
|
GL.lastError = errorCode;
|
||
|
}
|
||
|
},
|
||
|
getNewId: function(table) {
|
||
|
var ret = GL.counter++;
|
||
|
for (var i = table.length; i < ret; i++) {
|
||
|
table[i] = null;
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
MINI_TEMP_BUFFER_SIZE: 256,
|
||
|
miniTempBuffer: null,
|
||
|
miniTempBufferViews: [ 0 ],
|
||
|
getSource: function(shader, count, string, length) {
|
||
|
var source = "";
|
||
|
for (var i = 0; i < count; ++i) {
|
||
|
var len = length ? HEAP32[length + i * 4 >> 2] : -1;
|
||
|
source += UTF8ToString(HEAP32[string + i * 4 >> 2], len < 0 ? undefined : len);
|
||
|
}
|
||
|
return source;
|
||
|
},
|
||
|
createContext: function(canvas, webGLContextAttributes) {
|
||
|
var ctx = canvas.getContext("webgl", webGLContextAttributes) || canvas.getContext("experimental-webgl", webGLContextAttributes);
|
||
|
return ctx && GL.registerContext(ctx, webGLContextAttributes);
|
||
|
},
|
||
|
registerContext: function(ctx, webGLContextAttributes) {
|
||
|
var handle = _malloc(8);
|
||
|
var context = {
|
||
|
handle: handle,
|
||
|
attributes: webGLContextAttributes,
|
||
|
version: webGLContextAttributes.majorVersion,
|
||
|
GLctx: ctx
|
||
|
};
|
||
|
if (ctx.canvas) ctx.canvas.GLctxObject = context;
|
||
|
GL.contexts[handle] = context;
|
||
|
if (typeof webGLContextAttributes.enableExtensionsByDefault === "undefined" || webGLContextAttributes.enableExtensionsByDefault) {
|
||
|
GL.initExtensions(context);
|
||
|
}
|
||
|
return handle;
|
||
|
},
|
||
|
makeContextCurrent: function(contextHandle) {
|
||
|
GL.currentContext = GL.contexts[contextHandle];
|
||
|
Module.ctx = GLctx = GL.currentContext && GL.currentContext.GLctx;
|
||
|
return !(contextHandle && !GLctx);
|
||
|
},
|
||
|
getContext: function(contextHandle) {
|
||
|
return GL.contexts[contextHandle];
|
||
|
},
|
||
|
deleteContext: function(contextHandle) {
|
||
|
if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null;
|
||
|
if (typeof JSEvents === "object") JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);
|
||
|
if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined;
|
||
|
_free(GL.contexts[contextHandle]);
|
||
|
GL.contexts[contextHandle] = null;
|
||
|
},
|
||
|
initExtensions: function(context) {
|
||
|
if (!context) context = GL.currentContext;
|
||
|
if (context.initExtensionsDone) return;
|
||
|
context.initExtensionsDone = true;
|
||
|
var GLctx = context.GLctx;
|
||
|
if (context.version < 2) {
|
||
|
var instancedArraysExt = GLctx.getExtension("ANGLE_instanced_arrays");
|
||
|
if (instancedArraysExt) {
|
||
|
GLctx["vertexAttribDivisor"] = function(index, divisor) {
|
||
|
instancedArraysExt["vertexAttribDivisorANGLE"](index, divisor);
|
||
|
};
|
||
|
GLctx["drawArraysInstanced"] = function(mode, first, count, primcount) {
|
||
|
instancedArraysExt["drawArraysInstancedANGLE"](mode, first, count, primcount);
|
||
|
};
|
||
|
GLctx["drawElementsInstanced"] = function(mode, count, type, indices, primcount) {
|
||
|
instancedArraysExt["drawElementsInstancedANGLE"](mode, count, type, indices, primcount);
|
||
|
};
|
||
|
}
|
||
|
var vaoExt = GLctx.getExtension("OES_vertex_array_object");
|
||
|
if (vaoExt) {
|
||
|
GLctx["createVertexArray"] = function() {
|
||
|
return vaoExt["createVertexArrayOES"]();
|
||
|
};
|
||
|
GLctx["deleteVertexArray"] = function(vao) {
|
||
|
vaoExt["deleteVertexArrayOES"](vao);
|
||
|
};
|
||
|
GLctx["bindVertexArray"] = function(vao) {
|
||
|
vaoExt["bindVertexArrayOES"](vao);
|
||
|
};
|
||
|
GLctx["isVertexArray"] = function(vao) {
|
||
|
return vaoExt["isVertexArrayOES"](vao);
|
||
|
};
|
||
|
}
|
||
|
var drawBuffersExt = GLctx.getExtension("WEBGL_draw_buffers");
|
||
|
if (drawBuffersExt) {
|
||
|
GLctx["drawBuffers"] = function(n, bufs) {
|
||
|
drawBuffersExt["drawBuffersWEBGL"](n, bufs);
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
GLctx.disjointTimerQueryExt = GLctx.getExtension("EXT_disjoint_timer_query");
|
||
|
var automaticallyEnabledExtensions = [ "OES_texture_float", "OES_texture_half_float", "OES_standard_derivatives", "OES_vertex_array_object", "WEBGL_compressed_texture_s3tc", "WEBGL_depth_texture", "OES_element_index_uint", "EXT_texture_filter_anisotropic", "EXT_frag_depth", "WEBGL_draw_buffers", "ANGLE_instanced_arrays", "OES_texture_float_linear", "OES_texture_half_float_linear", "EXT_blend_minmax", "EXT_shader_texture_lod", "WEBGL_compressed_texture_pvrtc", "EXT_color_buffer_half_float", "WEBGL_color_buffer_float", "EXT_sRGB", "WEBGL_compressed_texture_etc1", "EXT_disjoint_timer_query", "WEBGL_compressed_texture_etc", "WEBGL_compressed_texture_astc", "EXT_color_buffer_float", "WEBGL_compressed_texture_s3tc_srgb", "EXT_disjoint_timer_query_webgl2" ];
|
||
|
var exts = GLctx.getSupportedExtensions();
|
||
|
if (exts && exts.length > 0) {
|
||
|
GLctx.getSupportedExtensions().forEach(function(ext) {
|
||
|
if (automaticallyEnabledExtensions.indexOf(ext) != -1) {
|
||
|
GLctx.getExtension(ext);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
populateUniformTable: function(program) {
|
||
|
var p = GL.programs[program];
|
||
|
var ptable = GL.programInfos[program] = {
|
||
|
uniforms: {},
|
||
|
maxUniformLength: 0,
|
||
|
maxAttributeLength: -1,
|
||
|
maxUniformBlockNameLength: -1
|
||
|
};
|
||
|
var utable = ptable.uniforms;
|
||
|
var numUniforms = GLctx.getProgramParameter(p, 35718);
|
||
|
for (var i = 0; i < numUniforms; ++i) {
|
||
|
var u = GLctx.getActiveUniform(p, i);
|
||
|
var name = u.name;
|
||
|
ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1);
|
||
|
var ls = name.lastIndexOf("[");
|
||
|
if (ls > 0) {
|
||
|
name = name.slice(0, ls);
|
||
|
}
|
||
|
var loc = GLctx.getUniformLocation(p, name);
|
||
|
if (loc) {
|
||
|
var id = GL.getNewId(GL.uniforms);
|
||
|
utable[name] = [ u.size, id ];
|
||
|
GL.uniforms[id] = loc;
|
||
|
for (var j = 1; j < u.size; ++j) {
|
||
|
var n = name + "[" + j + "]";
|
||
|
loc = GLctx.getUniformLocation(p, n);
|
||
|
id = GL.getNewId(GL.uniforms);
|
||
|
GL.uniforms[id] = loc;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function _SDL_SetVideoMode(width, height, depth, flags) {
|
||
|
[ "touchstart", "touchend", "touchmove", "mousedown", "mouseup", "mousemove", "DOMMouseScroll", "mousewheel", "wheel", "mouseout" ].forEach(function(event) {
|
||
|
Module["canvas"].addEventListener(event, SDL.receiveEvent, true);
|
||
|
});
|
||
|
var canvas = Module["canvas"];
|
||
|
if (width == 0 && height == 0) {
|
||
|
width = canvas.width;
|
||
|
height = canvas.height;
|
||
|
}
|
||
|
if (!SDL.addedResizeListener) {
|
||
|
SDL.addedResizeListener = true;
|
||
|
Browser.resizeListeners.push(function(w, h) {
|
||
|
if (!SDL.settingVideoMode) {
|
||
|
SDL.receiveEvent({
|
||
|
type: "resize",
|
||
|
w: w,
|
||
|
h: h
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
SDL.settingVideoMode = true;
|
||
|
Browser.setCanvasSize(width, height);
|
||
|
SDL.settingVideoMode = false;
|
||
|
if (SDL.screen) {
|
||
|
SDL.freeSurface(SDL.screen);
|
||
|
assert(!SDL.screen);
|
||
|
}
|
||
|
if (SDL.GL) flags = flags | 67108864;
|
||
|
SDL.screen = SDL.makeSurface(width, height, flags, true, "screen");
|
||
|
return SDL.screen;
|
||
|
}
|
||
|
|
||
|
function _SDL_UnlockAudio() {}
|
||
|
|
||
|
function _SDL_UnlockSurface(surf) {
|
||
|
assert(!SDL.GL);
|
||
|
var surfData = SDL.surfaces[surf];
|
||
|
if (!surfData.locked || --surfData.locked > 0) {
|
||
|
return;
|
||
|
}
|
||
|
if (surfData.isFlagSet(2097152)) {
|
||
|
SDL.copyIndexedColorData(surfData);
|
||
|
} else if (!surfData.colors) {
|
||
|
var data = surfData.image.data;
|
||
|
var buffer = surfData.buffer;
|
||
|
assert(buffer % 4 == 0, "Invalid buffer offset: " + buffer);
|
||
|
var src = buffer >> 2;
|
||
|
var dst = 0;
|
||
|
var isScreen = surf == SDL.screen;
|
||
|
var num;
|
||
|
if (typeof CanvasPixelArray !== "undefined" && data instanceof CanvasPixelArray) {
|
||
|
num = data.length;
|
||
|
while (dst < num) {
|
||
|
var val = HEAP32[src];
|
||
|
data[dst] = val & 255;
|
||
|
data[dst + 1] = val >> 8 & 255;
|
||
|
data[dst + 2] = val >> 16 & 255;
|
||
|
data[dst + 3] = isScreen ? 255 : val >> 24 & 255;
|
||
|
src++;
|
||
|
dst += 4;
|
||
|
}
|
||
|
} else {
|
||
|
var data32 = new Uint32Array(data.buffer);
|
||
|
if (isScreen && SDL.defaults.opaqueFrontBuffer) {
|
||
|
num = data32.length;
|
||
|
data32.set(HEAP32.subarray(src, src + num));
|
||
|
var data8 = new Uint8Array(data.buffer);
|
||
|
var i = 3;
|
||
|
var j = i + 4 * num;
|
||
|
if (num % 8 == 0) {
|
||
|
while (i < j) {
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
}
|
||
|
} else {
|
||
|
while (i < j) {
|
||
|
data8[i] = 255;
|
||
|
i = i + 4 | 0;
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
data32.set(HEAP32.subarray(src, src + data32.length));
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
var width = Module["canvas"].width;
|
||
|
var height = Module["canvas"].height;
|
||
|
var s = surfData.buffer;
|
||
|
var data = surfData.image.data;
|
||
|
var colors = surfData.colors;
|
||
|
for (var y = 0; y < height; y++) {
|
||
|
var base = y * width * 4;
|
||
|
for (var x = 0; x < width; x++) {
|
||
|
var val = HEAPU8[s++ >> 0] * 4;
|
||
|
var start = base + x * 4;
|
||
|
data[start] = colors[val];
|
||
|
data[start + 1] = colors[val + 1];
|
||
|
data[start + 2] = colors[val + 2];
|
||
|
}
|
||
|
s += width * 3;
|
||
|
}
|
||
|
}
|
||
|
surfData.ctx.putImageData(surfData.image, 0, 0);
|
||
|
}
|
||
|
|
||
|
var ENV = {};
|
||
|
|
||
|
function ___buildEnvironment(environ) {
|
||
|
var MAX_ENV_VALUES = 64;
|
||
|
var TOTAL_ENV_SIZE = 1024;
|
||
|
var poolPtr;
|
||
|
var envPtr;
|
||
|
if (!___buildEnvironment.called) {
|
||
|
___buildEnvironment.called = true;
|
||
|
ENV["USER"] = ENV["LOGNAME"] = "web_user";
|
||
|
ENV["PATH"] = "/";
|
||
|
ENV["PWD"] = "/";
|
||
|
ENV["HOME"] = "/home/web_user";
|
||
|
ENV["LANG"] = "C.UTF-8";
|
||
|
ENV["_"] = Module["thisProgram"];
|
||
|
poolPtr = getMemory(TOTAL_ENV_SIZE);
|
||
|
envPtr = getMemory(MAX_ENV_VALUES * 4);
|
||
|
HEAP32[envPtr >> 2] = poolPtr;
|
||
|
HEAP32[environ >> 2] = envPtr;
|
||
|
} else {
|
||
|
envPtr = HEAP32[environ >> 2];
|
||
|
poolPtr = HEAP32[envPtr >> 2];
|
||
|
}
|
||
|
var strings = [];
|
||
|
var totalSize = 0;
|
||
|
for (var key in ENV) {
|
||
|
if (typeof ENV[key] === "string") {
|
||
|
var line = key + "=" + ENV[key];
|
||
|
strings.push(line);
|
||
|
totalSize += line.length;
|
||
|
}
|
||
|
}
|
||
|
if (totalSize > TOTAL_ENV_SIZE) {
|
||
|
throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");
|
||
|
}
|
||
|
var ptrSize = 4;
|
||
|
for (var i = 0; i < strings.length; i++) {
|
||
|
var line = strings[i];
|
||
|
writeAsciiToMemory(line, poolPtr);
|
||
|
HEAP32[envPtr + i * ptrSize >> 2] = poolPtr;
|
||
|
poolPtr += line.length + 1;
|
||
|
}
|
||
|
HEAP32[envPtr + strings.length * ptrSize >> 2] = 0;
|
||
|
}
|
||
|
|
||
|
function ___lock() {}
|
||
|
|
||
|
var ERRNO_CODES = {
|
||
|
EPERM: 1,
|
||
|
ENOENT: 2,
|
||
|
ESRCH: 3,
|
||
|
EINTR: 4,
|
||
|
EIO: 5,
|
||
|
ENXIO: 6,
|
||
|
E2BIG: 7,
|
||
|
ENOEXEC: 8,
|
||
|
EBADF: 9,
|
||
|
ECHILD: 10,
|
||
|
EAGAIN: 11,
|
||
|
EWOULDBLOCK: 11,
|
||
|
ENOMEM: 12,
|
||
|
EACCES: 13,
|
||
|
EFAULT: 14,
|
||
|
ENOTBLK: 15,
|
||
|
EBUSY: 16,
|
||
|
EEXIST: 17,
|
||
|
EXDEV: 18,
|
||
|
ENODEV: 19,
|
||
|
ENOTDIR: 20,
|
||
|
EISDIR: 21,
|
||
|
EINVAL: 22,
|
||
|
ENFILE: 23,
|
||
|
EMFILE: 24,
|
||
|
ENOTTY: 25,
|
||
|
ETXTBSY: 26,
|
||
|
EFBIG: 27,
|
||
|
ENOSPC: 28,
|
||
|
ESPIPE: 29,
|
||
|
EROFS: 30,
|
||
|
EMLINK: 31,
|
||
|
EPIPE: 32,
|
||
|
EDOM: 33,
|
||
|
ERANGE: 34,
|
||
|
ENOMSG: 42,
|
||
|
EIDRM: 43,
|
||
|
ECHRNG: 44,
|
||
|
EL2NSYNC: 45,
|
||
|
EL3HLT: 46,
|
||
|
EL3RST: 47,
|
||
|
ELNRNG: 48,
|
||
|
EUNATCH: 49,
|
||
|
ENOCSI: 50,
|
||
|
EL2HLT: 51,
|
||
|
EDEADLK: 35,
|
||
|
ENOLCK: 37,
|
||
|
EBADE: 52,
|
||
|
EBADR: 53,
|
||
|
EXFULL: 54,
|
||
|
ENOANO: 55,
|
||
|
EBADRQC: 56,
|
||
|
EBADSLT: 57,
|
||
|
EDEADLOCK: 35,
|
||
|
EBFONT: 59,
|
||
|
ENOSTR: 60,
|
||
|
ENODATA: 61,
|
||
|
ETIME: 62,
|
||
|
ENOSR: 63,
|
||
|
ENONET: 64,
|
||
|
ENOPKG: 65,
|
||
|
EREMOTE: 66,
|
||
|
ENOLINK: 67,
|
||
|
EADV: 68,
|
||
|
ESRMNT: 69,
|
||
|
ECOMM: 70,
|
||
|
EPROTO: 71,
|
||
|
EMULTIHOP: 72,
|
||
|
EDOTDOT: 73,
|
||
|
EBADMSG: 74,
|
||
|
ENOTUNIQ: 76,
|
||
|
EBADFD: 77,
|
||
|
EREMCHG: 78,
|
||
|
ELIBACC: 79,
|
||
|
ELIBBAD: 80,
|
||
|
ELIBSCN: 81,
|
||
|
ELIBMAX: 82,
|
||
|
ELIBEXEC: 83,
|
||
|
ENOSYS: 38,
|
||
|
ENOTEMPTY: 39,
|
||
|
ENAMETOOLONG: 36,
|
||
|
ELOOP: 40,
|
||
|
EOPNOTSUPP: 95,
|
||
|
EPFNOSUPPORT: 96,
|
||
|
ECONNRESET: 104,
|
||
|
ENOBUFS: 105,
|
||
|
EAFNOSUPPORT: 97,
|
||
|
EPROTOTYPE: 91,
|
||
|
ENOTSOCK: 88,
|
||
|
ENOPROTOOPT: 92,
|
||
|
ESHUTDOWN: 108,
|
||
|
ECONNREFUSED: 111,
|
||
|
EADDRINUSE: 98,
|
||
|
ECONNABORTED: 103,
|
||
|
ENETUNREACH: 101,
|
||
|
ENETDOWN: 100,
|
||
|
ETIMEDOUT: 110,
|
||
|
EHOSTDOWN: 112,
|
||
|
EHOSTUNREACH: 113,
|
||
|
EINPROGRESS: 115,
|
||
|
EALREADY: 114,
|
||
|
EDESTADDRREQ: 89,
|
||
|
EMSGSIZE: 90,
|
||
|
EPROTONOSUPPORT: 93,
|
||
|
ESOCKTNOSUPPORT: 94,
|
||
|
EADDRNOTAVAIL: 99,
|
||
|
ENETRESET: 102,
|
||
|
EISCONN: 106,
|
||
|
ENOTCONN: 107,
|
||
|
ETOOMANYREFS: 109,
|
||
|
EUSERS: 87,
|
||
|
EDQUOT: 122,
|
||
|
ESTALE: 116,
|
||
|
ENOTSUP: 95,
|
||
|
ENOMEDIUM: 123,
|
||
|
EILSEQ: 84,
|
||
|
EOVERFLOW: 75,
|
||
|
ECANCELED: 125,
|
||
|
ENOTRECOVERABLE: 131,
|
||
|
EOWNERDEAD: 130,
|
||
|
ESTRPIPE: 86
|
||
|
};
|
||
|
|
||
|
var SYSCALLS = {
|
||
|
DEFAULT_POLLMASK: 5,
|
||
|
mappings: {},
|
||
|
umask: 511,
|
||
|
calculateAt: function(dirfd, path) {
|
||
|
if (path[0] !== "/") {
|
||
|
var dir;
|
||
|
if (dirfd === -100) {
|
||
|
dir = FS.cwd();
|
||
|
} else {
|
||
|
var dirstream = FS.getStream(dirfd);
|
||
|
if (!dirstream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
dir = dirstream.path;
|
||
|
}
|
||
|
path = PATH.join2(dir, path);
|
||
|
}
|
||
|
return path;
|
||
|
},
|
||
|
doStat: function(func, path, buf) {
|
||
|
try {
|
||
|
var stat = func(path);
|
||
|
} catch (e) {
|
||
|
if (e && e.node && PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node))) {
|
||
|
return -ERRNO_CODES.ENOTDIR;
|
||
|
}
|
||
|
throw e;
|
||
|
}
|
||
|
HEAP32[buf >> 2] = stat.dev;
|
||
|
HEAP32[buf + 4 >> 2] = 0;
|
||
|
HEAP32[buf + 8 >> 2] = stat.ino;
|
||
|
HEAP32[buf + 12 >> 2] = stat.mode;
|
||
|
HEAP32[buf + 16 >> 2] = stat.nlink;
|
||
|
HEAP32[buf + 20 >> 2] = stat.uid;
|
||
|
HEAP32[buf + 24 >> 2] = stat.gid;
|
||
|
HEAP32[buf + 28 >> 2] = stat.rdev;
|
||
|
HEAP32[buf + 32 >> 2] = 0;
|
||
|
HEAP32[buf + 36 >> 2] = stat.size;
|
||
|
HEAP32[buf + 40 >> 2] = 4096;
|
||
|
HEAP32[buf + 44 >> 2] = stat.blocks;
|
||
|
HEAP32[buf + 48 >> 2] = stat.atime.getTime() / 1e3 | 0;
|
||
|
HEAP32[buf + 52 >> 2] = 0;
|
||
|
HEAP32[buf + 56 >> 2] = stat.mtime.getTime() / 1e3 | 0;
|
||
|
HEAP32[buf + 60 >> 2] = 0;
|
||
|
HEAP32[buf + 64 >> 2] = stat.ctime.getTime() / 1e3 | 0;
|
||
|
HEAP32[buf + 68 >> 2] = 0;
|
||
|
HEAP32[buf + 72 >> 2] = stat.ino;
|
||
|
return 0;
|
||
|
},
|
||
|
doMsync: function(addr, stream, len, flags) {
|
||
|
var buffer = new Uint8Array(HEAPU8.subarray(addr, addr + len));
|
||
|
FS.msync(stream, buffer, 0, len, flags);
|
||
|
},
|
||
|
doMkdir: function(path, mode) {
|
||
|
path = PATH.normalize(path);
|
||
|
if (path[path.length - 1] === "/") path = path.substr(0, path.length - 1);
|
||
|
FS.mkdir(path, mode, 0);
|
||
|
return 0;
|
||
|
},
|
||
|
doMknod: function(path, mode, dev) {
|
||
|
switch (mode & 61440) {
|
||
|
case 32768:
|
||
|
case 8192:
|
||
|
case 24576:
|
||
|
case 4096:
|
||
|
case 49152:
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
return -ERRNO_CODES.EINVAL;
|
||
|
}
|
||
|
FS.mknod(path, mode, dev);
|
||
|
return 0;
|
||
|
},
|
||
|
doReadlink: function(path, buf, bufsize) {
|
||
|
if (bufsize <= 0) return -ERRNO_CODES.EINVAL;
|
||
|
var ret = FS.readlink(path);
|
||
|
var len = Math.min(bufsize, lengthBytesUTF8(ret));
|
||
|
var endChar = HEAP8[buf + len];
|
||
|
stringToUTF8(ret, buf, bufsize + 1);
|
||
|
HEAP8[buf + len] = endChar;
|
||
|
return len;
|
||
|
},
|
||
|
doAccess: function(path, amode) {
|
||
|
if (amode & ~7) {
|
||
|
return -ERRNO_CODES.EINVAL;
|
||
|
}
|
||
|
var node;
|
||
|
var lookup = FS.lookupPath(path, {
|
||
|
follow: true
|
||
|
});
|
||
|
node = lookup.node;
|
||
|
var perms = "";
|
||
|
if (amode & 4) perms += "r";
|
||
|
if (amode & 2) perms += "w";
|
||
|
if (amode & 1) perms += "x";
|
||
|
if (perms && FS.nodePermissions(node, perms)) {
|
||
|
return -ERRNO_CODES.EACCES;
|
||
|
}
|
||
|
return 0;
|
||
|
},
|
||
|
doDup: function(path, flags, suggestFD) {
|
||
|
var suggest = FS.getStream(suggestFD);
|
||
|
if (suggest) FS.close(suggest);
|
||
|
return FS.open(path, flags, 0, suggestFD, suggestFD).fd;
|
||
|
},
|
||
|
doReadv: function(stream, iov, iovcnt, offset) {
|
||
|
var ret = 0;
|
||
|
for (var i = 0; i < iovcnt; i++) {
|
||
|
var ptr = HEAP32[iov + i * 8 >> 2];
|
||
|
var len = HEAP32[iov + (i * 8 + 4) >> 2];
|
||
|
var curr = FS.read(stream, HEAP8, ptr, len, offset);
|
||
|
if (curr < 0) return -1;
|
||
|
ret += curr;
|
||
|
if (curr < len) break;
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
doWritev: function(stream, iov, iovcnt, offset) {
|
||
|
var ret = 0;
|
||
|
for (var i = 0; i < iovcnt; i++) {
|
||
|
var ptr = HEAP32[iov + i * 8 >> 2];
|
||
|
var len = HEAP32[iov + (i * 8 + 4) >> 2];
|
||
|
var curr = FS.write(stream, HEAP8, ptr, len, offset);
|
||
|
if (curr < 0) return -1;
|
||
|
ret += curr;
|
||
|
}
|
||
|
return ret;
|
||
|
},
|
||
|
varargs: 0,
|
||
|
get: function(varargs) {
|
||
|
SYSCALLS.varargs += 4;
|
||
|
var ret = HEAP32[SYSCALLS.varargs - 4 >> 2];
|
||
|
return ret;
|
||
|
},
|
||
|
getStr: function() {
|
||
|
var ret = UTF8ToString(SYSCALLS.get());
|
||
|
return ret;
|
||
|
},
|
||
|
getStreamFromFD: function() {
|
||
|
var stream = FS.getStream(SYSCALLS.get());
|
||
|
if (!stream) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
return stream;
|
||
|
},
|
||
|
getSocketFromFD: function() {
|
||
|
var socket = SOCKFS.getSocket(SYSCALLS.get());
|
||
|
if (!socket) throw new FS.ErrnoError(ERRNO_CODES.EBADF);
|
||
|
return socket;
|
||
|
},
|
||
|
getSocketAddress: function(allowNull) {
|
||
|
var addrp = SYSCALLS.get(), addrlen = SYSCALLS.get();
|
||
|
if (allowNull && addrp === 0) return null;
|
||
|
var info = __read_sockaddr(addrp, addrlen);
|
||
|
if (info.errno) throw new FS.ErrnoError(info.errno);
|
||
|
info.addr = DNS.lookup_addr(info.addr) || info.addr;
|
||
|
return info;
|
||
|
},
|
||
|
get64: function() {
|
||
|
var low = SYSCALLS.get(), high = SYSCALLS.get();
|
||
|
return low;
|
||
|
},
|
||
|
getZero: function() {
|
||
|
SYSCALLS.get();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function ___syscall140(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD(), offset_high = SYSCALLS.get(), offset_low = SYSCALLS.get(), result = SYSCALLS.get(), whence = SYSCALLS.get();
|
||
|
var offset = offset_low;
|
||
|
FS.llseek(stream, offset, whence);
|
||
|
HEAP32[result >> 2] = stream.position;
|
||
|
if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null;
|
||
|
return 0;
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall145(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD(), iov = SYSCALLS.get(), iovcnt = SYSCALLS.get();
|
||
|
return SYSCALLS.doReadv(stream, iov, iovcnt);
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall146(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD(), iov = SYSCALLS.get(), iovcnt = SYSCALLS.get();
|
||
|
return SYSCALLS.doWritev(stream, iov, iovcnt);
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall195(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var path = SYSCALLS.getStr(), buf = SYSCALLS.get();
|
||
|
return SYSCALLS.doStat(FS.stat, path, buf);
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall220(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD(), dirp = SYSCALLS.get(), count = SYSCALLS.get();
|
||
|
if (!stream.getdents) {
|
||
|
stream.getdents = FS.readdir(stream.path);
|
||
|
}
|
||
|
var pos = 0;
|
||
|
while (stream.getdents.length > 0 && pos + 268 <= count) {
|
||
|
var id;
|
||
|
var type;
|
||
|
var name = stream.getdents.pop();
|
||
|
if (name[0] === ".") {
|
||
|
id = 1;
|
||
|
type = 4;
|
||
|
} else {
|
||
|
var child = FS.lookupNode(stream.node, name);
|
||
|
id = child.id;
|
||
|
type = FS.isChrdev(child.mode) ? 2 : FS.isDir(child.mode) ? 4 : FS.isLink(child.mode) ? 10 : 8;
|
||
|
}
|
||
|
HEAP32[dirp + pos >> 2] = id;
|
||
|
HEAP32[dirp + pos + 4 >> 2] = stream.position;
|
||
|
HEAP16[dirp + pos + 8 >> 1] = 268;
|
||
|
HEAP8[dirp + pos + 10 >> 0] = type;
|
||
|
stringToUTF8(name, dirp + pos + 11, 256);
|
||
|
pos += 268;
|
||
|
}
|
||
|
return pos;
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall221(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD(), cmd = SYSCALLS.get();
|
||
|
switch (cmd) {
|
||
|
case 0:
|
||
|
{
|
||
|
var arg = SYSCALLS.get();
|
||
|
if (arg < 0) {
|
||
|
return -ERRNO_CODES.EINVAL;
|
||
|
}
|
||
|
var newStream;
|
||
|
newStream = FS.open(stream.path, stream.flags, 0, arg);
|
||
|
return newStream.fd;
|
||
|
}
|
||
|
|
||
|
case 1:
|
||
|
case 2:
|
||
|
return 0;
|
||
|
|
||
|
case 3:
|
||
|
return stream.flags;
|
||
|
|
||
|
case 4:
|
||
|
{
|
||
|
var arg = SYSCALLS.get();
|
||
|
stream.flags |= arg;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
case 12:
|
||
|
{
|
||
|
var arg = SYSCALLS.get();
|
||
|
var offset = 0;
|
||
|
HEAP16[arg + offset >> 1] = 2;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
case 13:
|
||
|
case 14:
|
||
|
return 0;
|
||
|
|
||
|
case 16:
|
||
|
case 8:
|
||
|
return -ERRNO_CODES.EINVAL;
|
||
|
|
||
|
case 9:
|
||
|
___setErrNo(ERRNO_CODES.EINVAL);
|
||
|
return -1;
|
||
|
|
||
|
default:
|
||
|
{
|
||
|
return -ERRNO_CODES.EINVAL;
|
||
|
}
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall5(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var pathname = SYSCALLS.getStr(), flags = SYSCALLS.get(), mode = SYSCALLS.get();
|
||
|
var stream = FS.open(pathname, flags, mode);
|
||
|
return stream.fd;
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall54(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD(), op = SYSCALLS.get();
|
||
|
switch (op) {
|
||
|
case 21509:
|
||
|
case 21505:
|
||
|
{
|
||
|
if (!stream.tty) return -ERRNO_CODES.ENOTTY;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
case 21510:
|
||
|
case 21511:
|
||
|
case 21512:
|
||
|
case 21506:
|
||
|
case 21507:
|
||
|
case 21508:
|
||
|
{
|
||
|
if (!stream.tty) return -ERRNO_CODES.ENOTTY;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
case 21519:
|
||
|
{
|
||
|
if (!stream.tty) return -ERRNO_CODES.ENOTTY;
|
||
|
var argp = SYSCALLS.get();
|
||
|
HEAP32[argp >> 2] = 0;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
case 21520:
|
||
|
{
|
||
|
if (!stream.tty) return -ERRNO_CODES.ENOTTY;
|
||
|
return -ERRNO_CODES.EINVAL;
|
||
|
}
|
||
|
|
||
|
case 21531:
|
||
|
{
|
||
|
var argp = SYSCALLS.get();
|
||
|
return FS.ioctl(stream, op, argp);
|
||
|
}
|
||
|
|
||
|
case 21523:
|
||
|
{
|
||
|
if (!stream.tty) return -ERRNO_CODES.ENOTTY;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
case 21524:
|
||
|
{
|
||
|
if (!stream.tty) return -ERRNO_CODES.ENOTTY;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
default:
|
||
|
abort("bad ioctl syscall " + op);
|
||
|
}
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___syscall6(which, varargs) {
|
||
|
SYSCALLS.varargs = varargs;
|
||
|
try {
|
||
|
var stream = SYSCALLS.getStreamFromFD();
|
||
|
FS.close(stream);
|
||
|
return 0;
|
||
|
} catch (e) {
|
||
|
if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
|
||
|
return -e.errno;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ___unlock() {}
|
||
|
|
||
|
function _abort() {
|
||
|
Module["abort"]();
|
||
|
}
|
||
|
|
||
|
function _emscripten_async_wget_data(url, arg, onload, onerror) {
|
||
|
Browser.asyncLoad(UTF8ToString(url), function(byteArray) {
|
||
|
var buffer = _malloc(byteArray.length);
|
||
|
HEAPU8.set(byteArray, buffer);
|
||
|
dynCall_viii(onload, arg, buffer, byteArray.length);
|
||
|
_free(buffer);
|
||
|
}, function() {
|
||
|
if (onerror) dynCall_vi(onerror, arg);
|
||
|
}, true);
|
||
|
}
|
||
|
|
||
|
function _emscripten_get_heap_size() {
|
||
|
return TOTAL_MEMORY;
|
||
|
}
|
||
|
|
||
|
function abortOnCannotGrowMemory(requestedSize) {
|
||
|
abort("Cannot enlarge memory arrays to size " + requestedSize + " bytes. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value " + TOTAL_MEMORY + ", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ");
|
||
|
}
|
||
|
|
||
|
function _emscripten_resize_heap(requestedSize) {
|
||
|
abortOnCannotGrowMemory(requestedSize);
|
||
|
}
|
||
|
|
||
|
function _exit(status) {
|
||
|
exit(status);
|
||
|
}
|
||
|
|
||
|
var ___tm_current = 3042576;
|
||
|
|
||
|
var ___tm_timezone = (stringToUTF8("GMT", 3042624, 4), 3042624);
|
||
|
|
||
|
function _gmtime_r(time, tmPtr) {
|
||
|
var date = new Date(HEAP32[time >> 2] * 1e3);
|
||
|
HEAP32[tmPtr >> 2] = date.getUTCSeconds();
|
||
|
HEAP32[tmPtr + 4 >> 2] = date.getUTCMinutes();
|
||
|
HEAP32[tmPtr + 8 >> 2] = date.getUTCHours();
|
||
|
HEAP32[tmPtr + 12 >> 2] = date.getUTCDate();
|
||
|
HEAP32[tmPtr + 16 >> 2] = date.getUTCMonth();
|
||
|
HEAP32[tmPtr + 20 >> 2] = date.getUTCFullYear() - 1900;
|
||
|
HEAP32[tmPtr + 24 >> 2] = date.getUTCDay();
|
||
|
HEAP32[tmPtr + 36 >> 2] = 0;
|
||
|
HEAP32[tmPtr + 32 >> 2] = 0;
|
||
|
var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0);
|
||
|
var yday = (date.getTime() - start) / (1e3 * 60 * 60 * 24) | 0;
|
||
|
HEAP32[tmPtr + 28 >> 2] = yday;
|
||
|
HEAP32[tmPtr + 40 >> 2] = ___tm_timezone;
|
||
|
return tmPtr;
|
||
|
}
|
||
|
|
||
|
function _gmtime(time) {
|
||
|
return _gmtime_r(time, ___tm_current);
|
||
|
}
|
||
|
|
||
|
function _tzset() {
|
||
|
if (_tzset.called) return;
|
||
|
_tzset.called = true;
|
||
|
HEAP32[__get_timezone() >> 2] = new Date().getTimezoneOffset() * 60;
|
||
|
var winter = new Date(2e3, 0, 1);
|
||
|
var summer = new Date(2e3, 6, 1);
|
||
|
HEAP32[__get_daylight() >> 2] = Number(winter.getTimezoneOffset() != summer.getTimezoneOffset());
|
||
|
function extractZone(date) {
|
||
|
var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/);
|
||
|
return match ? match[1] : "GMT";
|
||
|
}
|
||
|
var winterName = extractZone(winter);
|
||
|
var summerName = extractZone(summer);
|
||
|
var winterNamePtr = allocate(intArrayFromString(winterName), "i8", ALLOC_NORMAL);
|
||
|
var summerNamePtr = allocate(intArrayFromString(summerName), "i8", ALLOC_NORMAL);
|
||
|
if (summer.getTimezoneOffset() < winter.getTimezoneOffset()) {
|
||
|
HEAP32[__get_tzname() >> 2] = winterNamePtr;
|
||
|
HEAP32[__get_tzname() + 4 >> 2] = summerNamePtr;
|
||
|
} else {
|
||
|
HEAP32[__get_tzname() >> 2] = summerNamePtr;
|
||
|
HEAP32[__get_tzname() + 4 >> 2] = winterNamePtr;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _localtime_r(time, tmPtr) {
|
||
|
_tzset();
|
||
|
var date = new Date(HEAP32[time >> 2] * 1e3);
|
||
|
HEAP32[tmPtr >> 2] = date.getSeconds();
|
||
|
HEAP32[tmPtr + 4 >> 2] = date.getMinutes();
|
||
|
HEAP32[tmPtr + 8 >> 2] = date.getHours();
|
||
|
HEAP32[tmPtr + 12 >> 2] = date.getDate();
|
||
|
HEAP32[tmPtr + 16 >> 2] = date.getMonth();
|
||
|
HEAP32[tmPtr + 20 >> 2] = date.getFullYear() - 1900;
|
||
|
HEAP32[tmPtr + 24 >> 2] = date.getDay();
|
||
|
var start = new Date(date.getFullYear(), 0, 1);
|
||
|
var yday = (date.getTime() - start.getTime()) / (1e3 * 60 * 60 * 24) | 0;
|
||
|
HEAP32[tmPtr + 28 >> 2] = yday;
|
||
|
HEAP32[tmPtr + 36 >> 2] = -(date.getTimezoneOffset() * 60);
|
||
|
var summerOffset = new Date(2e3, 6, 1).getTimezoneOffset();
|
||
|
var winterOffset = start.getTimezoneOffset();
|
||
|
var dst = (summerOffset != winterOffset && date.getTimezoneOffset() == Math.min(winterOffset, summerOffset)) | 0;
|
||
|
HEAP32[tmPtr + 32 >> 2] = dst;
|
||
|
var zonePtr = HEAP32[__get_tzname() + (dst ? 4 : 0) >> 2];
|
||
|
HEAP32[tmPtr + 40 >> 2] = zonePtr;
|
||
|
return tmPtr;
|
||
|
}
|
||
|
|
||
|
function _localtime(time) {
|
||
|
return _localtime_r(time, ___tm_current);
|
||
|
}
|
||
|
|
||
|
function _longjmp(env, value) {
|
||
|
_setThrew(env, value || 1);
|
||
|
throw "longjmp";
|
||
|
}
|
||
|
|
||
|
function _emscripten_memcpy_big(dest, src, num) {
|
||
|
HEAPU8.set(HEAPU8.subarray(src, src + num), dest);
|
||
|
}
|
||
|
|
||
|
function __isLeapYear(year) {
|
||
|
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
||
|
}
|
||
|
|
||
|
function __arraySum(array, index) {
|
||
|
var sum = 0;
|
||
|
for (var i = 0; i <= index; sum += array[i++]) ;
|
||
|
return sum;
|
||
|
}
|
||
|
|
||
|
var __MONTH_DAYS_LEAP = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
|
||
|
|
||
|
var __MONTH_DAYS_REGULAR = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];
|
||
|
|
||
|
function __addDays(date, days) {
|
||
|
var newDate = new Date(date.getTime());
|
||
|
while (days > 0) {
|
||
|
var leap = __isLeapYear(newDate.getFullYear());
|
||
|
var currentMonth = newDate.getMonth();
|
||
|
var daysInCurrentMonth = (leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR)[currentMonth];
|
||
|
if (days > daysInCurrentMonth - newDate.getDate()) {
|
||
|
days -= daysInCurrentMonth - newDate.getDate() + 1;
|
||
|
newDate.setDate(1);
|
||
|
if (currentMonth < 11) {
|
||
|
newDate.setMonth(currentMonth + 1);
|
||
|
} else {
|
||
|
newDate.setMonth(0);
|
||
|
newDate.setFullYear(newDate.getFullYear() + 1);
|
||
|
}
|
||
|
} else {
|
||
|
newDate.setDate(newDate.getDate() + days);
|
||
|
return newDate;
|
||
|
}
|
||
|
}
|
||
|
return newDate;
|
||
|
}
|
||
|
|
||
|
function _strftime(s, maxsize, format, tm) {
|
||
|
var tm_zone = HEAP32[tm + 40 >> 2];
|
||
|
var date = {
|
||
|
tm_sec: HEAP32[tm >> 2],
|
||
|
tm_min: HEAP32[tm + 4 >> 2],
|
||
|
tm_hour: HEAP32[tm + 8 >> 2],
|
||
|
tm_mday: HEAP32[tm + 12 >> 2],
|
||
|
tm_mon: HEAP32[tm + 16 >> 2],
|
||
|
tm_year: HEAP32[tm + 20 >> 2],
|
||
|
tm_wday: HEAP32[tm + 24 >> 2],
|
||
|
tm_yday: HEAP32[tm + 28 >> 2],
|
||
|
tm_isdst: HEAP32[tm + 32 >> 2],
|
||
|
tm_gmtoff: HEAP32[tm + 36 >> 2],
|
||
|
tm_zone: tm_zone ? UTF8ToString(tm_zone) : ""
|
||
|
};
|
||
|
var pattern = UTF8ToString(format);
|
||
|
var EXPANSION_RULES_1 = {
|
||
|
"%c": "%a %b %d %H:%M:%S %Y",
|
||
|
"%D": "%m/%d/%y",
|
||
|
"%F": "%Y-%m-%d",
|
||
|
"%h": "%b",
|
||
|
"%r": "%I:%M:%S %p",
|
||
|
"%R": "%H:%M",
|
||
|
"%T": "%H:%M:%S",
|
||
|
"%x": "%m/%d/%y",
|
||
|
"%X": "%H:%M:%S"
|
||
|
};
|
||
|
for (var rule in EXPANSION_RULES_1) {
|
||
|
pattern = pattern.replace(new RegExp(rule, "g"), EXPANSION_RULES_1[rule]);
|
||
|
}
|
||
|
var WEEKDAYS = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ];
|
||
|
var MONTHS = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
|
||
|
function leadingSomething(value, digits, character) {
|
||
|
var str = typeof value === "number" ? value.toString() : value || "";
|
||
|
while (str.length < digits) {
|
||
|
str = character[0] + str;
|
||
|
}
|
||
|
return str;
|
||
|
}
|
||
|
function leadingNulls(value, digits) {
|
||
|
return leadingSomething(value, digits, "0");
|
||
|
}
|
||
|
function compareByDay(date1, date2) {
|
||
|
function sgn(value) {
|
||
|
return value < 0 ? -1 : value > 0 ? 1 : 0;
|
||
|
}
|
||
|
var compare;
|
||
|
if ((compare = sgn(date1.getFullYear() - date2.getFullYear())) === 0) {
|
||
|
if ((compare = sgn(date1.getMonth() - date2.getMonth())) === 0) {
|
||
|
compare = sgn(date1.getDate() - date2.getDate());
|
||
|
}
|
||
|
}
|
||
|
return compare;
|
||
|
}
|
||
|
function getFirstWeekStartDate(janFourth) {
|
||
|
switch (janFourth.getDay()) {
|
||
|
case 0:
|
||
|
return new Date(janFourth.getFullYear() - 1, 11, 29);
|
||
|
|
||
|
case 1:
|
||
|
return janFourth;
|
||
|
|
||
|
case 2:
|
||
|
return new Date(janFourth.getFullYear(), 0, 3);
|
||
|
|
||
|
case 3:
|
||
|
return new Date(janFourth.getFullYear(), 0, 2);
|
||
|
|
||
|
case 4:
|
||
|
return new Date(janFourth.getFullYear(), 0, 1);
|
||
|
|
||
|
case 5:
|
||
|
return new Date(janFourth.getFullYear() - 1, 11, 31);
|
||
|
|
||
|
case 6:
|
||
|
return new Date(janFourth.getFullYear() - 1, 11, 30);
|
||
|
}
|
||
|
}
|
||
|
function getWeekBasedYear(date) {
|
||
|
var thisDate = __addDays(new Date(date.tm_year + 1900, 0, 1), date.tm_yday);
|
||
|
var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);
|
||
|
var janFourthNextYear = new Date(thisDate.getFullYear() + 1, 0, 4);
|
||
|
var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);
|
||
|
var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);
|
||
|
if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) {
|
||
|
if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) {
|
||
|
return thisDate.getFullYear() + 1;
|
||
|
} else {
|
||
|
return thisDate.getFullYear();
|
||
|
}
|
||
|
} else {
|
||
|
return thisDate.getFullYear() - 1;
|
||
|
}
|
||
|
}
|
||
|
var EXPANSION_RULES_2 = {
|
||
|
"%a": function(date) {
|
||
|
return WEEKDAYS[date.tm_wday].substring(0, 3);
|
||
|
},
|
||
|
"%A": function(date) {
|
||
|
return WEEKDAYS[date.tm_wday];
|
||
|
},
|
||
|
"%b": function(date) {
|
||
|
return MONTHS[date.tm_mon].substring(0, 3);
|
||
|
},
|
||
|
"%B": function(date) {
|
||
|
return MONTHS[date.tm_mon];
|
||
|
},
|
||
|
"%C": function(date) {
|
||
|
var year = date.tm_year + 1900;
|
||
|
return leadingNulls(year / 100 | 0, 2);
|
||
|
},
|
||
|
"%d": function(date) {
|
||
|
return leadingNulls(date.tm_mday, 2);
|
||
|
},
|
||
|
"%e": function(date) {
|
||
|
return leadingSomething(date.tm_mday, 2, " ");
|
||
|
},
|
||
|
"%g": function(date) {
|
||
|
return getWeekBasedYear(date).toString().substring(2);
|
||
|
},
|
||
|
"%G": function(date) {
|
||
|
return getWeekBasedYear(date);
|
||
|
},
|
||
|
"%H": function(date) {
|
||
|
return leadingNulls(date.tm_hour, 2);
|
||
|
},
|
||
|
"%I": function(date) {
|
||
|
var twelveHour = date.tm_hour;
|
||
|
if (twelveHour == 0) twelveHour = 12; else if (twelveHour > 12) twelveHour -= 12;
|
||
|
return leadingNulls(twelveHour, 2);
|
||
|
},
|
||
|
"%j": function(date) {
|
||
|
return leadingNulls(date.tm_mday + __arraySum(__isLeapYear(date.tm_year + 1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date.tm_mon - 1), 3);
|
||
|
},
|
||
|
"%m": function(date) {
|
||
|
return leadingNulls(date.tm_mon + 1, 2);
|
||
|
},
|
||
|
"%M": function(date) {
|
||
|
return leadingNulls(date.tm_min, 2);
|
||
|
},
|
||
|
"%n": function() {
|
||
|
return "\n";
|
||
|
},
|
||
|
"%p": function(date) {
|
||
|
if (date.tm_hour >= 0 && date.tm_hour < 12) {
|
||
|
return "AM";
|
||
|
} else {
|
||
|
return "PM";
|
||
|
}
|
||
|
},
|
||
|
"%S": function(date) {
|
||
|
return leadingNulls(date.tm_sec, 2);
|
||
|
},
|
||
|
"%t": function() {
|
||
|
return "\t";
|
||
|
},
|
||
|
"%u": function(date) {
|
||
|
var day = new Date(date.tm_year + 1900, date.tm_mon + 1, date.tm_mday, 0, 0, 0, 0);
|
||
|
return day.getDay() || 7;
|
||
|
},
|
||
|
"%U": function(date) {
|
||
|
var janFirst = new Date(date.tm_year + 1900, 0, 1);
|
||
|
var firstSunday = janFirst.getDay() === 0 ? janFirst : __addDays(janFirst, 7 - janFirst.getDay());
|
||
|
var endDate = new Date(date.tm_year + 1900, date.tm_mon, date.tm_mday);
|
||
|
if (compareByDay(firstSunday, endDate) < 0) {
|
||
|
var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth() - 1) - 31;
|
||
|
var firstSundayUntilEndJanuary = 31 - firstSunday.getDate();
|
||
|
var days = firstSundayUntilEndJanuary + februaryFirstUntilEndMonth + endDate.getDate();
|
||
|
return leadingNulls(Math.ceil(days / 7), 2);
|
||
|
}
|
||
|
return compareByDay(firstSunday, janFirst) === 0 ? "01" : "00";
|
||
|
},
|
||
|
"%V": function(date) {
|
||
|
var janFourthThisYear = new Date(date.tm_year + 1900, 0, 4);
|
||
|
var janFourthNextYear = new Date(date.tm_year + 1901, 0, 4);
|
||
|
var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);
|
||
|
var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear);
|
||
|
var endDate = __addDays(new Date(date.tm_year + 1900, 0, 1), date.tm_yday);
|
||
|
if (compareByDay(endDate, firstWeekStartThisYear) < 0) {
|
||
|
return "53";
|
||
|
}
|
||
|
if (compareByDay(firstWeekStartNextYear, endDate) <= 0) {
|
||
|
return "01";
|
||
|
}
|
||
|
var daysDifference;
|
||
|
if (firstWeekStartThisYear.getFullYear() < date.tm_year + 1900) {
|
||
|
daysDifference = date.tm_yday + 32 - firstWeekStartThisYear.getDate();
|
||
|
} else {
|
||
|
daysDifference = date.tm_yday + 1 - firstWeekStartThisYear.getDate();
|
||
|
}
|
||
|
return leadingNulls(Math.ceil(daysDifference / 7), 2);
|
||
|
},
|
||
|
"%w": function(date) {
|
||
|
var day = new Date(date.tm_year + 1900, date.tm_mon + 1, date.tm_mday, 0, 0, 0, 0);
|
||
|
return day.getDay();
|
||
|
},
|
||
|
"%W": function(date) {
|
||
|
var janFirst = new Date(date.tm_year, 0, 1);
|
||
|
var firstMonday = janFirst.getDay() === 1 ? janFirst : __addDays(janFirst, janFirst.getDay() === 0 ? 1 : 7 - janFirst.getDay() + 1);
|
||
|
var endDate = new Date(date.tm_year + 1900, date.tm_mon, date.tm_mday);
|
||
|
if (compareByDay(firstMonday, endDate) < 0) {
|
||
|
var februaryFirstUntilEndMonth = __arraySum(__isLeapYear(endDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, endDate.getMonth() - 1) - 31;
|
||
|
var firstMondayUntilEndJanuary = 31 - firstMonday.getDate();
|
||
|
var days = firstMondayUntilEndJanuary + februaryFirstUntilEndMonth + endDate.getDate();
|
||
|
return leadingNulls(Math.ceil(days / 7), 2);
|
||
|
}
|
||
|
return compareByDay(firstMonday, janFirst) === 0 ? "01" : "00";
|
||
|
},
|
||
|
"%y": function(date) {
|
||
|
return (date.tm_year + 1900).toString().substring(2);
|
||
|
},
|
||
|
"%Y": function(date) {
|
||
|
return date.tm_year + 1900;
|
||
|
},
|
||
|
"%z": function(date) {
|
||
|
var off = date.tm_gmtoff;
|
||
|
var ahead = off >= 0;
|
||
|
off = Math.abs(off) / 60;
|
||
|
off = off / 60 * 100 + off % 60;
|
||
|
return (ahead ? "+" : "-") + String("0000" + off).slice(-4);
|
||
|
},
|
||
|
"%Z": function(date) {
|
||
|
return date.tm_zone;
|
||
|
},
|
||
|
"%%": function() {
|
||
|
return "%";
|
||
|
}
|
||
|
};
|
||
|
for (var rule in EXPANSION_RULES_2) {
|
||
|
if (pattern.indexOf(rule) >= 0) {
|
||
|
pattern = pattern.replace(new RegExp(rule, "g"), EXPANSION_RULES_2[rule](date));
|
||
|
}
|
||
|
}
|
||
|
var bytes = intArrayFromString(pattern, false);
|
||
|
if (bytes.length > maxsize) {
|
||
|
return 0;
|
||
|
}
|
||
|
writeArrayToMemory(bytes, s);
|
||
|
return bytes.length - 1;
|
||
|
}
|
||
|
|
||
|
function _time(ptr) {
|
||
|
var ret = Date.now() / 1e3 | 0;
|
||
|
if (ptr) {
|
||
|
HEAP32[ptr >> 2] = ret;
|
||
|
}
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
FS.staticInit();
|
||
|
|
||
|
__ATINIT__.unshift(function() {
|
||
|
if (!Module["noFSInit"] && !FS.init.initialized) FS.init();
|
||
|
});
|
||
|
|
||
|
__ATMAIN__.push(function() {
|
||
|
FS.ignorePermissions = false;
|
||
|
});
|
||
|
|
||
|
__ATEXIT__.push(function() {
|
||
|
FS.quit();
|
||
|
});
|
||
|
|
||
|
Module["FS_createFolder"] = FS.createFolder;
|
||
|
|
||
|
Module["FS_createPath"] = FS.createPath;
|
||
|
|
||
|
Module["FS_createDataFile"] = FS.createDataFile;
|
||
|
|
||
|
Module["FS_createPreloadedFile"] = FS.createPreloadedFile;
|
||
|
|
||
|
Module["FS_createLazyFile"] = FS.createLazyFile;
|
||
|
|
||
|
Module["FS_createLink"] = FS.createLink;
|
||
|
|
||
|
Module["FS_createDevice"] = FS.createDevice;
|
||
|
|
||
|
Module["FS_unlink"] = FS.unlink;
|
||
|
|
||
|
__ATINIT__.unshift(function() {
|
||
|
TTY.init();
|
||
|
});
|
||
|
|
||
|
__ATEXIT__.push(function() {
|
||
|
TTY.shutdown();
|
||
|
});
|
||
|
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
var fs = require("fs");
|
||
|
var NODEJS_PATH = require("path");
|
||
|
NODEFS.staticInit();
|
||
|
}
|
||
|
|
||
|
Module["requestFullScreen"] = function Module_requestFullScreen(lockPointer, resizeCanvas, vrDevice) {
|
||
|
err("Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.");
|
||
|
Module["requestFullScreen"] = Module["requestFullscreen"];
|
||
|
Browser.requestFullScreen(lockPointer, resizeCanvas, vrDevice);
|
||
|
};
|
||
|
|
||
|
Module["requestFullscreen"] = function Module_requestFullscreen(lockPointer, resizeCanvas, vrDevice) {
|
||
|
Browser.requestFullscreen(lockPointer, resizeCanvas, vrDevice);
|
||
|
};
|
||
|
|
||
|
Module["requestAnimationFrame"] = function Module_requestAnimationFrame(func) {
|
||
|
Browser.requestAnimationFrame(func);
|
||
|
};
|
||
|
|
||
|
Module["setCanvasSize"] = function Module_setCanvasSize(width, height, noUpdates) {
|
||
|
Browser.setCanvasSize(width, height, noUpdates);
|
||
|
};
|
||
|
|
||
|
Module["pauseMainLoop"] = function Module_pauseMainLoop() {
|
||
|
Browser.mainLoop.pause();
|
||
|
};
|
||
|
|
||
|
Module["resumeMainLoop"] = function Module_resumeMainLoop() {
|
||
|
Browser.mainLoop.resume();
|
||
|
};
|
||
|
|
||
|
Module["getUserMedia"] = function Module_getUserMedia() {
|
||
|
Browser.getUserMedia();
|
||
|
};
|
||
|
|
||
|
Module["createContext"] = function Module_createContext(canvas, useWebGL, setInModule, webGLContextAttributes) {
|
||
|
return Browser.createContext(canvas, useWebGL, setInModule, webGLContextAttributes);
|
||
|
};
|
||
|
|
||
|
if (ENVIRONMENT_IS_NODE) {
|
||
|
_emscripten_get_now = function _emscripten_get_now_actual() {
|
||
|
var t = process["hrtime"]();
|
||
|
return t[0] * 1e3 + t[1] / 1e6;
|
||
|
};
|
||
|
} else if (typeof dateNow !== "undefined") {
|
||
|
_emscripten_get_now = dateNow;
|
||
|
} else if (typeof self === "object" && self["performance"] && typeof self["performance"]["now"] === "function") {
|
||
|
_emscripten_get_now = function() {
|
||
|
return self["performance"]["now"]();
|
||
|
};
|
||
|
} else if (typeof performance === "object" && typeof performance["now"] === "function") {
|
||
|
_emscripten_get_now = function() {
|
||
|
return performance["now"]();
|
||
|
};
|
||
|
} else {
|
||
|
_emscripten_get_now = Date.now;
|
||
|
}
|
||
|
|
||
|
var GLctx;
|
||
|
|
||
|
GL.init();
|
||
|
|
||
|
var ASSERTIONS = false;
|
||
|
|
||
|
function intArrayFromString(stringy, dontAddNull, length) {
|
||
|
var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
|
||
|
var u8array = new Array(len);
|
||
|
var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
|
||
|
if (dontAddNull) u8array.length = numBytesWritten;
|
||
|
return u8array;
|
||
|
}
|
||
|
|
||
|
function intArrayToString(array) {
|
||
|
var ret = [];
|
||
|
for (var i = 0; i < array.length; i++) {
|
||
|
var chr = array[i];
|
||
|
if (chr > 255) {
|
||
|
if (ASSERTIONS) {
|
||
|
assert(false, "Character code " + chr + " (" + String.fromCharCode(chr) + ") at offset " + i + " not in 0x00-0xFF.");
|
||
|
}
|
||
|
chr &= 255;
|
||
|
}
|
||
|
ret.push(String.fromCharCode(chr));
|
||
|
}
|
||
|
return ret.join("");
|
||
|
}
|
||
|
|
||
|
var decodeBase64 = typeof atob === "function" ? atob : function(input) {
|
||
|
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||
|
var output = "";
|
||
|
var chr1, chr2, chr3;
|
||
|
var enc1, enc2, enc3, enc4;
|
||
|
var i = 0;
|
||
|
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||
|
do {
|
||
|
enc1 = keyStr.indexOf(input.charAt(i++));
|
||
|
enc2 = keyStr.indexOf(input.charAt(i++));
|
||
|
enc3 = keyStr.indexOf(input.charAt(i++));
|
||
|
enc4 = keyStr.indexOf(input.charAt(i++));
|
||
|
chr1 = enc1 << 2 | enc2 >> 4;
|
||
|
chr2 = (enc2 & 15) << 4 | enc3 >> 2;
|
||
|
chr3 = (enc3 & 3) << 6 | enc4;
|
||
|
output = output + String.fromCharCode(chr1);
|
||
|
if (enc3 !== 64) {
|
||
|
output = output + String.fromCharCode(chr2);
|
||
|
}
|
||
|
if (enc4 !== 64) {
|
||
|
output = output + String.fromCharCode(chr3);
|
||
|
}
|
||
|
} while (i < input.length);
|
||
|
return output;
|
||
|
};
|
||
|
|
||
|
function intArrayFromBase64(s) {
|
||
|
if (typeof ENVIRONMENT_IS_NODE === "boolean" && ENVIRONMENT_IS_NODE) {
|
||
|
var buf;
|
||
|
try {
|
||
|
buf = Buffer.from(s, "base64");
|
||
|
} catch (_) {
|
||
|
buf = new Buffer(s, "base64");
|
||
|
}
|
||
|
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
|
||
|
}
|
||
|
try {
|
||
|
var decoded = decodeBase64(s);
|
||
|
var bytes = new Uint8Array(decoded.length);
|
||
|
for (var i = 0; i < decoded.length; ++i) {
|
||
|
bytes[i] = decoded.charCodeAt(i);
|
||
|
}
|
||
|
return bytes;
|
||
|
} catch (_) {
|
||
|
throw new Error("Converting base64 string to bytes failed.");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function tryParseAsDataURI(filename) {
|
||
|
if (!isDataURI(filename)) {
|
||
|
return;
|
||
|
}
|
||
|
return intArrayFromBase64(filename.slice(dataURIPrefix.length));
|
||
|
}
|
||
|
|
||
|
function invoke_vii(index, a1, a2) {
|
||
|
var sp = stackSave();
|
||
|
try {
|
||
|
dynCall_vii(index, a1, a2);
|
||
|
} catch (e) {
|
||
|
stackRestore(sp);
|
||
|
if (e !== e + 0 && e !== "longjmp") throw e;
|
||
|
_setThrew(1, 0);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var asmGlobalArg = {
|
||
|
"Math": Math,
|
||
|
"Int8Array": Int8Array,
|
||
|
"Int16Array": Int16Array,
|
||
|
"Int32Array": Int32Array,
|
||
|
"Uint8Array": Uint8Array,
|
||
|
"Uint16Array": Uint16Array,
|
||
|
"Float32Array": Float32Array,
|
||
|
"Float64Array": Float64Array,
|
||
|
"NaN": NaN,
|
||
|
Infinity: Infinity
|
||
|
};
|
||
|
|
||
|
var asmLibraryArg = {
|
||
|
"a": abort,
|
||
|
"b": setTempRet0,
|
||
|
"c": getTempRet0,
|
||
|
"d": invoke_vii,
|
||
|
"e": _SDL_ClearError,
|
||
|
"f": _SDL_GetError,
|
||
|
"g": _SDL_GetModState,
|
||
|
"h": _SDL_GetMouseState,
|
||
|
"i": _SDL_GetTicks,
|
||
|
"j": _SDL_GetWindowSize,
|
||
|
"k": _SDL_Init,
|
||
|
"l": _SDL_LockAudio,
|
||
|
"m": _SDL_LockSurface,
|
||
|
"n": _SDL_PollEvent,
|
||
|
"o": _SDL_SetVideoMode,
|
||
|
"p": _SDL_UnlockAudio,
|
||
|
"q": _SDL_UnlockSurface,
|
||
|
"r": ___buildEnvironment,
|
||
|
"s": ___lock,
|
||
|
"t": ___setErrNo,
|
||
|
"u": ___syscall140,
|
||
|
"v": ___syscall145,
|
||
|
"w": ___syscall146,
|
||
|
"x": ___syscall195,
|
||
|
"y": ___syscall220,
|
||
|
"z": ___syscall221,
|
||
|
"A": ___syscall5,
|
||
|
"B": ___syscall54,
|
||
|
"C": ___syscall6,
|
||
|
"D": ___unlock,
|
||
|
"E": __addDays,
|
||
|
"F": __arraySum,
|
||
|
"G": __isLeapYear,
|
||
|
"H": _abort,
|
||
|
"I": _emscripten_asm_const_i,
|
||
|
"J": _emscripten_asm_const_ii,
|
||
|
"K": _emscripten_asm_const_iii,
|
||
|
"L": _emscripten_asm_const_iiiiiii,
|
||
|
"M": _emscripten_async_wget_data,
|
||
|
"N": _emscripten_get_heap_size,
|
||
|
"O": _emscripten_get_now,
|
||
|
"P": _emscripten_memcpy_big,
|
||
|
"Q": _emscripten_resize_heap,
|
||
|
"R": _emscripten_set_main_loop,
|
||
|
"S": _emscripten_set_main_loop_timing,
|
||
|
"T": _exit,
|
||
|
"U": _gmtime,
|
||
|
"V": _gmtime_r,
|
||
|
"W": _localtime,
|
||
|
"X": _localtime_r,
|
||
|
"Y": _longjmp,
|
||
|
"Z": _strftime,
|
||
|
"_": _time,
|
||
|
"$": _tzset,
|
||
|
"aa": abortOnCannotGrowMemory,
|
||
|
"ab": tempDoublePtr,
|
||
|
"ac": DYNAMICTOP_PTR
|
||
|
};
|
||
|
|
||
|
// EMSCRIPTEN_START_ASM
|
||
|
|
||
|
|
||
|
var asm = (/** @suppress {uselessCode} */ function(global,env,buffer) {
|
||
|
"use asm";var a=new global.Int8Array(buffer),b=new global.Int16Array(buffer),c=new global.Int32Array(buffer),d=new global.Uint8Array(buffer),e=new global.Uint16Array(buffer),f=new global.Float32Array(buffer),g=new global.Float64Array(buffer),h=env.ab|0,i=env.ac|0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0,r=global.NaN,s=global.Infinity,t=global.Math.floor,u=global.Math.abs,v=global.Math.sqrt,w=global.Math.cos,x=global.Math.sin,y=global.Math.atan,z=global.Math.atan2,A=global.Math.ceil,B=global.Math.imul,C=global.Math.min,D=global.Math.clz32,E=env.a,F=env.b,G=env.c,H=env.d,I=env.e,J=env.f,K=env.g,L=env.h,M=env.i,N=env.j,O=env.k,P=env.l,Q=env.m,R=env.n,S=env.o,T=env.p,U=env.q,V=env.r,W=env.s,X=env.t,Y=env.u,Z=env.v,_=env.w,$=env.x,aa=env.y,ba=env.z,ca=env.A,da=env.B,ea=env.C,fa=env.D,ga=env.E,ha=env.F,ia=env.G,ja=env.H,ka=env.I,la=env.J,ma=env.K,na=env.L,oa=env.M,pa=env.N,qa=env.O,ra=env.P,sa=env.Q,ta=env.R,ua=env.S,va=env.T,wa=env.U,xa=env.V,ya=env.W,za=env.X,Aa=env.Y,Ba=env.Z,Ca=env._,Da=env.$,Ea=env.aa,Fa=3042736,Ga=8285616,Ha=0.0;
|
||
|
// EMSCRIPTEN_START_FUNCS
|
||
|
function zf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;b=Fa;Fa=Fa+16|0;d=b+8|0;e=b;f=a+16|0;g=c[c[f>>2]>>2]|0;h=g+16|0;i=a+8|0;j=c[i>>2]|0;if(h>>>0>=j>>>0|(h|0)==2099900)k=-1;else k=c[g+20>>2]&15;h=g+8|0;if(!(h>>>0>=j>>>0|(h|0)==2099900)){h=c[g+12>>2]&15;if((h|0)!=5){l=h+1|0;m=6}}else{l=0;m=6}if((m|0)==6){m=c[16+(l<<2)>>2]|0;c[e>>2]=45485;c[e+4>>2]=m;jf(a,1,Dd(a,47715,e)|0)|0}switch(k|0){case 0:case 5:break;default:jf(a,2,48006)|0}if(rf(a,1,47994)|0)kf(a,48028,d)|0;d=c[c[f>>2]>>2]|0;f=c[i>>2]|0;k=d+24|0;if(f>>>0>=k>>>0){c[i>>2]=k;Ld(a,1)|0;Fa=b;return 1}e=(d+20+(3-f)|0)>>>3;d=f;do{c[d+4>>2]=0;d=d+8|0}while(d>>>0<k>>>0);c[i>>2]=f+(e+1<<3);c[i>>2]=k;Ld(a,1)|0;Fa=b;return 1}function Af(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;b=a+16|0;d=c[c[b>>2]>>2]|0;e=d+8|0;f=a+8|0;g=c[f>>2]|0;if(e>>>0>=g>>>0|(e|0)==2099900){jf(a,1,47735)|0;h=c[c[b>>2]>>2]|0;i=c[f>>2]|0}else{h=d;i=g}g=h+16|0;if(g>>>0>=i>>>0|(g|0)==2099900){jf(a,2,47735)|0;a=c[c[b>>2]>>2]|0;j=a+16|0;k=a;l=c[f>>2]|0}else{j=g;k=h;l=i}i=k+8|0;k=i>>>0<l>>>0?i:2099900;i=j>>>0<l>>>0?j:2099900;if((k|0)!=2099900&(i|0)!=2099900?(c[k+4>>2]|0)==(c[i+4>>2]|0):0){j=(Ec(0,k,i)|0)!=0&1;m=j;n=c[f>>2]|0}else{m=0;n=l}c[n>>2]=m;c[n+4>>2]=1;c[f>>2]=(c[f>>2]|0)+8;return 1}function Bf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0;b=a+16|0;d=c[c[b>>2]>>2]|0;e=d+8|0;f=a+8|0;g=c[f>>2]|0;if(!(e>>>0>=g>>>0|(e|0)==2099900)?(c[d+12>>2]&14|1|0)==5:0){h=e;i=g}else{jf(a,1,48064)|0;h=(c[c[b>>2]>>2]|0)+8|0;i=c[f>>2]|0}b=h>>>0<i>>>0?h:2099900;switch(c[b+4>>2]&15){case 4:{j=c[(c[b>>2]|0)+12>>2]|0;break}case 7:{j=c[(c[b>>2]|0)+16>>2]|0;break}case 5:{j=cd(c[b>>2]|0)|0;break}default:j=0}c[i>>2]=j<<16;c[i+4>>2]=3;c[f>>2]=(c[f>>2]|0)+8;return 1}function Cf(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=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n=c[16+(m<<2)>>2]|0;c[e>>2]=45485;c[e+4>>2]=n;jf(b,1,Dd(b,47715,e)|0)|0;k=c[c[f>>2]>>2]|0;l=c[i>>2]|0}e=k+16|0;if(e>>>0>=l>>>0|(e|0)==2099900){jf(b,2,47735)|0;o=c[c[f>>2]>>2]|0;p=c[i>>2]|0}else{o=k;p=l}l=o+24|0;if(l>>>0>=p>>>0|(l|0)==2099900){jf(b,3,47735)|0;q=c[c[f>>2]>>2]|0;r=c[i>>2]|0}else{q=o;r=p}p=q+8|0;o=q+32|0;if(r>>>0<o>>>0){f=(q+28+(3-r)|0)>>>3;l=r;do{c[l+4>>2]=0;l=l+8|0}while(l>>>0<o>>>0);c[i>>2]=r+(f+1<<3)}c[i>>2]=o;o=c[p>>2]|0;f=q+16|0;r=xc(o,f)|0;if((r|0)==2099900)s=yc(b,o,f)|0;else s=r;c[s>>2]=c[q+24>>2];c[s+4>>2]=c[q+28>>2];a[(c[p>>2]|0)+6>>0]=0;q=c[i>>2]|0;if(!(c[q+-4>>2]&64)){t=q;u=t+-16|0;c[i>>2]=u;Fa=d;return 1}if(!(a[(c[q+-8>>2]|0)+5>>0]&3)){t=q;u=t+-16|0;c[i>>2]=u;Fa=d;return 1}s=c[p>>2]|0;p=s+5|0;r=a[p>>0]|0;if(!(r&4)){t=q;u=t+-16|0;c[i>>2]=u;Fa=d;return 1}q=c[b+12>>2]|0;a[p>>0]=r&-5;r=q+76|0;c[s+24>>2]=c[r>>2];c[r>>2]=s;t=c[i>>2]|0;u=t+-16|0;c[i>>2]=u;Fa=d;return 1}function Ef(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;b=a+16|0;d=c[c[b>>2]>>2]|0;e=d+8|0;f=a+8|0;g=c[f>>2]|0;if(e>>>0>=g>>>0|(e|0)==2099900){jf(a,1,47735)|0;h=c[c[b>>2]>>2]|0;i=h+8|0;j=c[f>>2]|0;k=h}else{i=e;j=g;k=d}if(i>>>0>=j>>>0|(i|0)==2099900){l=0;m=16+(l<<2)|0;n=
|
||
|
function Sa(a){a=a|0;var b=0;b=Fa;Fa=Fa+a|0;Fa=Fa+15&-16;return b|0}function Ta(){return Fa|0}function Ua(a){a=a|0;Fa=a}function Va(a,b){a=a|0;b=b|0;Fa=a;Ga=b}function Wa(){return c[(c[(c[c[704870]>>2]|0)+16>>2]|0)+12>>2]|0}function Xa(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;c[742551]=(c[742551]|0)-a;b=128-a|0;d=c[704852]|0;if((b|0)>0){e=0;f=d;while(1){Oo(f,f,0,e+a|0,0,e,128,1);e=e+1|0;g=c[704852]|0;if((e|0)==(b|0)){h=b;i=g;break}else f=g}}else{h=0;i=d}$m(i,0,h,127,127,0);Vg(65536);return}function Ya(){var a=0,b=0;a=(c[742551]|0)+(c[742555]|0)|0;c[742551]=a;if((a|0)<=122)return;c[742551]=a+-6;a=0;b=c[704852]|0;do{Oo(b,b,0,a+6|0,0,a,128,1);a=a+1|0;b=c[704852]|0}while((a|0)!=122);$m(b,0,122,127,127,0);Vg(65536);return}function Za(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;b=Fa;Fa=Fa+224|0;d=b+208|0;e=b+200|0;f=b+192|0;g=b+184|0;h=b+176|0;i=b+168|0;j=b+160|0;k=b+152|0;l=b+144|0;m=b+136|0;n=b+128|0;o=b+120|0;p=b+112|0;q=b+104|0;r=b+96|0;s=b+88|0;t=b+80|0;u=b+72|0;v=b+64|0;w=b+8|0;x=b;y=b+212|0;if(!(ts(a,35736,9)|0))bo(a+10|0,2960076)|0;if(!(ts(a,35746,10)|0))bo(a+11|0,2962124)|0;if(!(ts(a,35757,14)|0)){c[x>>2]=1662220;Vt(a+14|0,35772,x)|0}if(!(ts(a,35776,11)|0)){c[w>>2]=1662256;c[w+4>>2]=1662260;c[w+8>>2]=1662264;c[w+12>>2]=1662268;c[w+16>>2]=1662272;c[w+20>>2]=1662276;c[w+24>>2]=1662280;c[w+28>>2]=1662284;c[w+32>>2]=1662288;c[w+36>>2]=1662292;c[w+40>>2]=1662296;c[w+44>>2]=1662300;c[w+48>>2]=1662304;Vt(a+11|0,35788,w)|0}if(!(ts(a,35828,10)|0)){c[v>>2]=1662384;Vt(a+10|0,35772,v)|0}if(!(ts(a,35839,11)|0)){c[u>>2]=1662412;Vt(a+11|0,35772,u)|0}if(!(ts(a,49212,7)|0)){c[t>>2]=1662416;Vt(a+7|0,35772,t)|0}if((ts(a,61771,6)|0)==0?(c[s>>2]=2062524,Vt(a+6|0,35772,s)|0,c[525853]|0):0)c[525853]=c[515631];if(!(ts(a,35851,9)|0)){c[r>>2]=1662428;Vt(a+9|0,35772,r)|0}if(!(ts(a,49599,16)|0)){c[q>>2]=1662400;Vt(a+16|0,35772,q)|0}if(!(ts(a,49500,9)|0)){c[p>>2]=1662404;Vt(a+9|0,35772,p)|0}if(!(ts(a,35861,12)|0)){c[o>>2]=1662444;Vt(a+12|0,35772,o)|0}if(!(ts(a,35874,20)|0)){c[n>>2]=2061964;Vt(a+20|0,35772,n)|0}if(!(ts(a,35895,22)|0)){c[m>>2]=2061968;Vt(a+22|0,35772,m)|0}if(!(ts(a,35918,14)|0)){c[l>>2]=y;Vt(a+14|0,35772,l)|0;c[415613]=(c[y>>2]|0)==2&1}if(!(ts(a,48923,13)|0)){c[k>>2]=1662452;Vt(a+13|0,35772,k)|0}if(!(ts(a,49705,9)|0)){c[j>>2]=1662388;Vt(a+9|0,35772,j)|0}if(!(ts(a,35933,9)|0)){c[i>>2]=1662392;Vt(a+9|0,35772,i)|0}if(!(ts(a,35943,19)|0)){c[h>>2]=1662244;Vt(a+19|0,35772,h)|0}if(!(ts(a,35963,19)|0)){c[g>>2]=1662240;Vt(a+19|0,35772,g)|0}if(!(ts(a,35983,22)|0)){c[f>>2]=1662248;Vt(a+22|0,35772,f)|0}if(!(ts(a,36006,11)|0)){c[e>>2]=1662436;Vt(a+11|0,35772,e)|0}if(ts(a,36018,14)|0){Fa=b;return 0}c[d>>2]=1662396;Vt(a+14|0,35772,d)|0;Fa=b;return 0}function _a(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;b=Fa;Fa=Fa+256|0;d=b+248|0;e=b+240|0;f=b+232|0;g=b+224|0;h=b+216|0;i=b+208|0;j=b+200|0;k=b+192|0;l=b+184|0;m=b+176|0;n=b+168|0;o=b+160|0;p=b+152|0;q=b+144|0;r=b+136|0;s=b+128|0;t=b+120|0;u=b+112|0;v=b+104|0;w=b+96|0;x=b+88|0;y=b+80|0;z=b+72|0;A=b+64|0;B=b+56|0;C=b+48|0;D=b+40|0;E=b+32|0;F=b+24|0;G=b+16|0;H=b+8|0;I=b;J=a+8|0;a=c[J>>2]|0;c[I>>2]=36046;bu(a,36033,I)|0;ku(36053,25,1,c[J>>2]|0)|0;I=c[J>>2]|0;c[H>>2]=c[515631];bu(I,36079,H)|0;ku(36091,37,1,c[J>>2]|0)|0;H=c[J>>2]|0;c[G>>2]=2960076;bu(H,36129,G)|0;ku(36144,36,1,c[J>>2]|0)|0;G=c[J>>2]|0;c[F>>2]=2962124;bu(G,36181,F)|0;ku(36197,65,1,c[J>>2]|0)|0;F=c[J>>2]|0;c[E>>2]=c[415555];bu(F,36263,E)|0;ku(36283,70,1,c[J>>2]|0)|0;ku(36354,12,1,c[J>>2]|0)|0;E=c[J>>2]|0;c[D>>2]=c[415564];bu(E,36367,D)|0;D=c[J>>2]|0;c[C>>2]=c[415565];bu(D,36367,C)|0;C=c[J>>2]|0;c[B>>2]=c[415566];bu(C,36367,B)|0;B=c[J>>2]|0;c[A>>2]=c[415567];bu(B,36367,A)|0;A=c[J>>2]|0;c[z>>2]=c[415568];bu(A,36367,z)|0;z=c[J>>2]|0;c[y>>2]=c[415569];bu(z,36367,y)|0;y=c[J>>2]|0;c[x>>2]=c[415570];bu(y,36367,x)|0;x=c[J>>2]|0;c[w>>2]=c[415571];bu(x,36367,w)|0;w=c[J>>2]|0;c[v>>2]=c[415572];bu(w,36367,v)|0;v=c[J>>2]|0;c[u>>2]=c[415573];bu(v,36367,u)|0;u=c[J>>2]|0;c[t>>2]=c[415574];b
|
||
|
function _d(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;d=c[a>>2]|0;e=a+28|0;f=c[e>>2]|0;g=a+20|0;h=c[g>>2]|0;do if((f|0)!=-1){i=c[d+12>>2]|0;j=f;while(1){k=i+(j<<2)|0;l=c[k>>2]|0;m=(l>>>14)+-131071|0;n=j;j=(m|0)==-1?-1:j+1+m|0;if((n|0)>0?(m=k+-4|0,o=c[m>>2]|0,((o&63)+-37|0)>>>0<5):0){p=m;q=o}else{p=k;q=l}if((q&63|0)==41){c[p>>2]=q&8372224|q>>>23<<6|40;o=h+~n|0;if((((o|0)>-1?o:0-o|0)|0)>131071){r=8;break}s=c[k>>2]&16383;t=(o<<14)+2147467264|0}else{o=h+~n|0;if((((o|0)>-1?o:0-o|0)|0)>131071){r=11;break}s=(o<<14)+2147467264|0;t=l&16383}c[k>>2]=s|t;if((j|0)==-1){r=14;break}}if((r|0)==8)be(c[a+12>>2]|0,46263);else if((r|0)==11)be(c[a+12>>2]|0,46263);else if((r|0)==14){u=c[g>>2]|0;break}}else u=h;while(0);c[e>>2]=-1;e=d+48|0;if((u|0)<(c[e>>2]|0)){v=c[d+12>>2]|0;w=u}else{u=d+12|0;h=ce(c[(c[a+12>>2]|0)+32>>2]|0,c[u>>2]|0,e,4,2147483645,46611)|0;c[u>>2]=h;v=h;w=c[g>>2]|0}c[v+(w<<2)>>2]=b;b=c[g>>2]|0;w=d+52|0;v=a+12|0;if((b|0)<(c[w>>2]|0)){x=d+20|0;y=b;z=c[v>>2]|0;A=z+8|0;B=c[A>>2]|0;C=c[x>>2]|0;D=C+(y<<2)|0;c[D>>2]=B;E=c[g>>2]|0;F=E+1|0;c[g>>2]=F;return E|0}else{b=d+20|0;c[b>>2]=ce(c[(c[v>>2]|0)+32>>2]|0,c[b>>2]|0,w,4,2147483645,46611)|0;x=b;y=c[g>>2]|0;z=c[v>>2]|0;A=z+8|0;B=c[A>>2]|0;C=c[x>>2]|0;D=C+(y<<2)|0;c[D>>2]=B;E=c[g>>2]|0;F=E+1|0;c[g>>2]=F;return E|0}return 0}function $d(e){e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;f=e+16|0;g=c[f>>2]|0;h=e+12|0;i=c[h>>2]|0;do if(c[g>>2]|0?a[g+9>>0]|0:0){j=e+28|0;k=c[j>>2]|0;c[j>>2]=-1;l=_d(e,2147450916)|0;do if((k|0)!=-1){if((l|0)==-1){m=k;n=d[g+8>>0]|0;break}o=c[(c[e>>2]|0)+12>>2]|0;p=l;while(1){q=o+(p<<2)|0;r=c[q>>2]|0;s=(r>>>14)+-131071|0;t=(s|0)==-1?-1:p+1+s|0;if((t|0)==-1)break;else p=t}o=k+~p|0;if((((o|0)>-1?o:0-o|0)|0)>131071)be(c[h>>2]|0,46263);else{c[q>>2]=(o<<14)+2147467264|r&16383;u=11;break}}else u=11;while(0);if((u|0)==11){k=d[g+8>>0]|0;if((l|0)==-1){c[e+24>>2]=c[e+20>>2];break}else{m=l;n=k}}k=c[(c[e>>2]|0)+12>>2]|0;o=(n<<6)+64&16320;t=m;do{s=k+(t<<2)|0;v=c[s>>2]|0;w=(v>>>14)+-131071|0;c[s>>2]=v&-16321|o;t=(w|0)==-1?-1:t+1+w|0}while((t|0)!=-1);c[e+24>>2]=c[e+20>>2];t=c[j>>2]|0;if((t|0)==-1){c[j>>2]=m;break}o=t;while(1){x=k+(o<<2)|0;y=c[x>>2]|0;t=(y>>>14)+-131071|0;l=(t|0)==-1?-1:o+1+t|0;if((l|0)==-1)break;else o=l}k=m+~o|0;if((((k|0)>-1?k:0-k|0)|0)>131071)be(c[h>>2]|0,46263);else{c[x>>2]=(k<<14)+2147467264|y&16383;break}}while(0);if(a[g+10>>0]|0){y=i+32|0;x=Oc(c[y>>2]|0,56767,5)|0;m=i+44|0;n=c[m>>2]|0;r=n+24|0;q=i+28|0;k=c[q>>2]|0;j=c[k+20>>2]|0;l=n+28|0;t=c[l>>2]|0;w=n+32|0;if((t|0)<(c[w>>2]|0)){z=k;A=t;B=n;C=c[r>>2]|0}else{n=ce(c[y>>2]|0,c[r>>2]|0,w,16,32767,46290)|0;c[r>>2]=n;z=c[q>>2]|0;A=c[l>>2]|0;B=c[m>>2]|0;C=n}c[C+(t<<4)>>2]=x;c[C+(t<<4)+8>>2]=0;a[C+(t<<4)+12>>0]=a[z+46>>0]|0;c[C+(t<<4)+4>>2]=j;c[l>>2]=A+1;A=(c[B+24>>2]|0)+(t<<4)|0;t=b[(c[z+16>>2]|0)+6>>1]|0;z=B+16|0;l=c[z>>2]|0;if((l|0)>(t|0)){j=B+12|0;B=t;t=l;while(1){l=c[(c[j>>2]|0)+(B<<4)>>2]|0;C=c[A>>2]|0;x=a[l+4>>0]|0;do if(x<<24>>24==(a[C+4>>0]|0)){if(x<<24>>24==4){if((l|0)!=(C|0)){u=35;break}}else{n=c[l+12>>2]|0;if((l|0)!=(C|0)){if((n|0)!=(c[C+12>>2]|0)){u=35;break}if(ss(l+16|0,C+16|0,n)|0){u=35;break}}}de(i,B,A);D=B;E=c[z>>2]|0}else u=35;while(0);if((u|0)==35){u=0;D=B+1|0;E=t}if((D|0)<(E|0)){B=D;t=E}else break}}}E=c[g>>2]|0;c[f>>2]=E;f=g+8|0;t=a[f>>0]|0;D=e+46|0;B=a[D>>0]|0;u=B&255;z=c[(c[h>>2]|0)+44>>2]|0;A=z+4|0;c[A>>2]=(t&255)-u+(c[A>>2]|0);if((t&255)<(B&255)){A=c[e+20>>2]|0;j=c[e+40>>2]|0;C=c[(c[e>>2]|0)+24>>2]|0;l=c[z>>2]|0;x=u;while(1){u=(x&255)+-1<<24>>24;c[C+((b[l+(j+(u&255)<<1)>>1]|0)*12|0)+8>>2]=A;if((u&255)>(t&255))x=x+-1|0;else break}a[D>>0]=t;F=t}else F=B;a[e+48>>0]=F;F=c[i+44>>2]|0;c[F+28>>2]=b[g+4>>1];B=b[g+6>>1]|0;if(!E)if((c[F+16>>2]|0)>(B|0))fe(i,(c[F+12>>2]|0)+(B<<4)|0);else return;F=z+16|0;if((c[F>>2]|0)<=(B|0))return;i=z+12|0;z=g+9|0;g=B;B=t;while(1){t=c[i>>2]|0;E=t+(g<<4)+12|0;D=B&255;if((d[E>>0]|0)>(B&255)){if(a[z>>0]|0?(x=c[t+(g<<4)+4>>2]|0,(x|0)!=-1):0){t=c[(c[e>>2]|0)+12>>2]|0;A=(D<<6)+64&16320;D=x;do{x=t+(D<<2)|0;j
|
||
|
function bl(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,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=0,Jh=0,Kh=0,Lh=0,Mh=0,Nh=0,Oh=0,Ph=0,Qh=0,Rh=0,Sh=0;g=Fa;Fa=Fa+4112|0;h=g+4108|0;i=g+4104|0;j=g+3072|0;k=g+2048|0;l=g+1024|0;m=g;n=g+4100|0;o=g+4096|0;p=0;do{c[j+(p<<2)>>2]=p;p=p+1|0}while((p|0)!=256);p=0;do{c[k+(c[j+(p<<2)>>2]<<2)>>2]=p;p=p+1|0}while((p|0)!=256);al(b,f);c[8783]=1;c[525045]=0;c[525043]=e;c[525044]=0;if(!f){q=0;Fa=g;return q|0}p=Fp(f)|0;Xu(p|0,b|0,f|0)|0;r=c[525043]|0;s=c[8783]|0;t=c[525044]|0;u=r+t|0;v=(s^255)&(d[u>>0]|0);a[u>>0]=v;w=s<<1;x=t+1|0;if((w|0)!=256){y=(w^255)&v;a[u>>0]=y;v=s<<2;if((v|0)==256){s=r+x|0;c[525044]=x;w=d[s>>0]|0;c[525045]=w;z=w&254;a[s>>0]=z;A=2;B=s;C=x;D=z;E=314}else{F=x;G=u;H=y;I=v;J=t;E=312}}else{v=r+x|0;c[525044]=x;y=d[v>>0]|0;c[525045]=y;u=y&254;a[v>>0]=u;F=t+2|0;G=v;H=u;I=2;J=x;E=312}do if((E|0)==312){x=(I^255)&(H&255);a[G>>0]=x;u=I<<1;if((u|0)==256){v=r+F|0;c[525044]=F;t=d[v>>0]|0;c[525045]=t;A=1;B=v;C=F;D=t;E=314;break}t=(u^255)&x;a[G>>0]=t;x=I<<2;if((x|0)==256){u=r+F|0;c[525044]=F;v=d[u>>0]|0;c[525045]=v;y=v&254;a[u>>0]=y;K=2;L=u;M=F;N=y;E=319}else{O=G;P=F;Q=t;R=x;S=J;E=317}}while(0);if((E|0)==314){J=(A^255)&D;a[B>>0]=J;O=B;P=C+1|0;Q=J;R=A<<1;S=C;E=317}do if((E|0)==317){C=(R^255)&(Q&255);a[O>>0]=C;A=R<<1;if((A|0)==256){J=r+P|0;c[525044]=P;B=d[J>>0]|0;c[525045]=B;K=1;L=J;M=P;N=B;E=319;break}B=(A^255)&C;a[O>>0]=B;C=R<<2;if((C|0)==256){A=r+P|0;c[525044]=P;J=d[A>>0]|0;c[525045]=J;D=J&254;a[A>>0]=D;T=2;U=A;V=P;W=D;E=324}else{X=O;Y=P;Z=B;_=C;$=S;E=322}}while(0);if((E|0)==319){S=(K^255)&N;a[L>>0]=S;X=L;Y=M+1|0;Z=S;_=K<<1;$=M;E=322}do if((E|0)==322){M=(_^255)&(Z&255);a[X>>0]=M;K=_<<1;if((K|0)==256){S=r+Y|0;c[525044]=Y;L=d[S>>0]|0;c[525045]=L;T=1;U=S;V=Y;W=L;E=324;break}L=(K^255)&M;a[X>>0]=L;M=_<<2;if((M|0)==256){K=r+Y|0;c[525044]=Y;S=d[K>>0]|0;c[525045]=S;aa=Y;ba=K;ca=Y+1|0;da=S;ea=1}else{fa=X;ga=Y;ha=L;ia=M;ja=$;E=326}}while(0);if((E|0)
|
||
|
function Dc(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=b+12|0;g=c[f>>2]|0;h=b+56|0;b=c[h>>2]|0;if(!b)return;i=g+48|0;j=g+56|0;k=g+50|0;l=g+49|0;m=b;while(1){b=m+8|0;n=c[b>>2]|0;if(n>>>0<e>>>0){o=16;break}c[h>>2]=c[m>>2];p=m+12|0;do if(((a[i>>0]^3)&(a[m+5>>0]^3))<<24>>24){q=m+16|0;c[(c[q>>2]|0)+12>>2]=c[p>>2];c[(c[p>>2]|0)+16>>2]=c[q>>2];r=c[b>>2]|0;c[p>>2]=c[r>>2];s=c[r+4>>2]|0;c[q>>2]=s;c[b>>2]=p;c[m>>2]=c[j>>2];c[j>>2]=m;q=m+5|0;r=a[q>>0]|0;t=r&255;if(!(t&7)){if((a[k>>0]|0)!=2?(d[l>>0]|0)>=2:0){a[q>>0]=t&184|a[i>>0]&3;break}a[q>>0]=r&-69|4;if(s&64|0?(s=c[p>>2]|0,a[s+5>>0]&3):0)uc(g,s)}}else{if((n|0)!=(p|0)){s=m+16|0;c[(c[s>>2]|0)+12>>2]=c[p>>2];c[(c[p>>2]|0)+16>>2]=c[s>>2]}s=c[f>>2]|0;Ma[c[s>>2]&1](c[s+4>>2]|0,m,20,0)|0;r=s+12|0;c[r>>2]=(c[r>>2]|0)+-20}while(0);m=c[h>>2]|0;if(!m){o=16;break}}if((o|0)==16)return}function Ec(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;h=Fa;Fa=Fa+16|0;i=h;j=f+4|0;a:do switch(c[j>>2]&63){case 0:{k=1;break}case 3:{k=(c[f>>2]|0)==(c[g>>2]|0);break}case 1:{k=(c[f>>2]|0)==(c[g>>2]|0);break}case 2:{k=(c[f>>2]|0)==(c[g>>2]|0);break}case 54:case 22:{k=(c[f>>2]|0)==(c[g>>2]|0);break}case 4:{k=(c[f>>2]|0)==(c[g>>2]|0);break}case 20:{l=c[f>>2]|0;m=c[g>>2]|0;n=c[l+12>>2]|0;if((l|0)!=(m|0))if((n|0)==(c[m+12>>2]|0))k=(ss(l+16|0,m+16|0,n)|0)==0;else k=0;else k=1;break}case 7:{n=c[f>>2]|0;m=c[g>>2]|0;if((n|0)!=(m|0))if(((e|0)!=0?(l=c[n+8>>2]|0,n=c[m+8>>2]|0,(l|0)!=0):0)?(m=l+6|0,o=a[m>>0]|0,(o&32)==0):0){p=c[(c[e+12>>2]|0)+176>>2]|0;q=c[p+8>>2]|0;r=(c[l+16>>2]|0)+(((1<<(d[l+7>>0]|0))+-1&q)*20|0)|0;while(1){if((c[r+12>>2]|0)==68?(c[r+8>>2]|0)==(p|0):0){s=17;break}t=c[r+16>>2]|0;if(!t){u=2099900;break}else r=t}if((s|0)==17)u=r;t=u+4|0;v=c[t>>2]|0;if(!v){a[m>>0]=o|32;k=0;break a}if(u)if((l|0)!=(n|0))if((n|0)!=0?(w=n+6|0,x=a[w>>0]|0,(x&32)==0):0){y=(c[n+16>>2]|0)+(((1<<(d[n+7>>0]|0))+-1&q)*20|0)|0;while(1){if((c[y+12>>2]|0)==68?(c[y+8>>2]|0)==(p|0):0){s=28;break}z=c[y+16>>2]|0;if(!z){A=2099900;break}else y=z}if((s|0)==28)A=y;p=c[A+4>>2]|0;if(!p){a[w>>0]=x|32;k=0;break a}if((A|0)!=0&(v|0)==(p|0)?(Ec(0,u,A)|0)!=0:0){B=u;C=t;s=59}else k=0}else k=0;else{B=u;C=t;s=59}else k=0}else k=0;else k=1;break}case 5:{p=c[f>>2]|0;q=c[g>>2]|0;if((p|0)!=(q|0))if(((e|0)!=0?(n=c[p+8>>2]|0,p=c[q+8>>2]|0,(n|0)!=0):0)?(q=n+6|0,l=a[q>>0]|0,(l&32)==0):0){o=c[(c[e+12>>2]|0)+176>>2]|0;m=c[o+8>>2]|0;r=(c[n+16>>2]|0)+(((1<<(d[n+7>>0]|0))+-1&m)*20|0)|0;while(1){if((c[r+12>>2]|0)==68?(c[r+8>>2]|0)==(o|0):0){s=41;break}z=c[r+16>>2]|0;if(!z){D=2099900;break}else r=z}if((s|0)==41)D=r;t=D+4|0;v=c[t>>2]|0;if(!v){a[q>>0]=l|32;k=0;break a}if(D)if((n|0)!=(p|0))if((p|0)!=0?(x=p+6|0,w=a[x>>0]|0,(w&32)==0):0){y=(c[p+16>>2]|0)+(((1<<(d[p+7>>0]|0))+-1&m)*20|0)|0;while(1){if((c[y+12>>2]|0)==68?(c[y+8>>2]|0)==(o|0):0){s=52;break}z=c[y+16>>2]|0;if(!z){E=2099900;break}else y=z}if((s|0)==52)E=y;o=c[E+4>>2]|0;if(!o){a[x>>0]=w|32;k=0;break a}if((E|0)!=0&(v|0)==(o|0)?(Ec(0,D,E)|0)!=0:0){B=D;C=t;s=59}else k=0}else k=0;else{B=D;C=t;s=59}else k=0}else k=0;else k=1;break}default:k=(c[f>>2]|0)==(c[g>>2]|0)}while(0);b:do if((s|0)==59){D=e+8|0;E=c[D>>2]|0;u=e+28|0;A=E-(c[u>>2]|0)|0;c[D>>2]=E+8;c[E>>2]=c[B>>2];c[E+4>>2]=c[C>>2];E=c[D>>2]|0;c[D>>2]=E+8;c[E>>2]=c[f>>2];c[E+4>>2]=c[j>>2];E=c[D>>2]|0;c[D>>2]=E+8;c[E>>2]=c[g>>2];c[E+4>>2]=c[g+4>>2];E=(c[D>>2]|0)+-24|0;o=a[(c[e+16>>2]|0)+18>>0]&1;m=e+38|0;p=(b[m>>1]|0)+1<<16>>16;b[m>>1]=p;if((p&65535)>199){if(p<<16>>16==200)lc(e,45525,i);if((p&65535)>224)jc(e,6)}p=o<<24>>24!=0;if(!p){o=e+36|0;b[o>>1]=(b[o>>1]|0)+1<<16>>16}if(!(pc(e,E,1)|0))qc(e);if(!p){p=e+36|0;b[p>>1]=(b[p>>1]|0)+-1<<16>>16}b[m>>1]=(b[m>>1]|0)+-1<<16>>16;m=(c[u>>2]|0)+A|0;A=c[D>>2]|0;u=A+-8|0;c[D>>2]=u;c[m>>2]=c[u>>2];c[m+4>>2]=c[A+-4>>2];A=c[D>>2]|0;switch(c[A+4>>2]|0){case 0:{k=0;break b;break}case 1:{k=(c[A>>2]|0)!=0;break b;break}default:{k=1;break b}}}while(0);Fa=h;return k&1|0}function Fc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;e=c[b+4>>2]|0;if((e|0)==3){if((c[d+4>>2]|0)==3){f=(c[b>>2]|0)<
|
||
|
function Bp(b,e,f,g,h,i){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0;j=Fa;Fa=Fa+64|0;k=j;switch(h|0){case 3:case 0:{l=1;break}case 2:{l=3;break}case 4:{l=2;break}case 6:{l=4;break}default:l=0}m=B(l,i)|0;l=((B(m,f)|0)+7|0)>>>3;f=(m+7|0)>>>3;if(!m){n=31;Fa=j;return n|0}if((h|0)==3|i>>>0<8){if(!g){n=0;Fa=j;return n|0}i=l+1|0;if(!l){h=0;do{a[b+(B(h,i)|0)>>0]=0;h=h+1|0}while((h|0)!=(g|0));n=0;Fa=j;return n|0}h=0;do{m=B(h,i)|0;o=B(h,l)|0;a[b+m>>0]=0;p=b+(m+1)|0;m=e+o|0;o=0;do{a[p+o>>0]=a[m+o>>0]|0;o=o+1|0}while((o|0)!=(l|0));h=h+1|0}while((h|0)!=(g|0));n=0;Fa=j;return n|0}h=k;i=h+60|0;do{c[h>>2]=0;h=h+4|0}while((h|0)<(i|0));h=l<<1;i=k+8|0;do if(!l){c[k+4>>2]=l;c[k+16>>2]=l;c[k+28>>2]=l;c[k+40>>2]=l;q=k+56|0;r=k+44|0;s=k+32|0;t=k+20|0;u=0;v=0;w=0;x=0;y=0;z=89}else{o=Gp(0,h)|0;if(o){c[i>>2]=h;c[k>>2]=o;c[k+4>>2]=l;m=k+20|0;p=Gp(0,h)|0;if(p){c[m>>2]=h;c[k+12>>2]=p;c[k+16>>2]=l;A=k+32|0;C=Gp(0,h)|0;if(C){c[A>>2]=h;c[k+24>>2]=C;c[k+28>>2]=l;D=k+44|0;E=Gp(0,h)|0;if(E){c[D>>2]=h;c[k+36>>2]=E;c[k+40>>2]=l;F=k+56|0;G=Gp(0,h)|0;if(!G){H=m;I=E;J=C;K=p;L=o}else{c[F>>2]=h;c[k+48>>2]=G;q=F;r=D;s=A;t=m;u=E;v=p;w=o;x=C;y=G;z=89;break}}else{H=m;I=0;J=C;K=p;L=o}}else{H=m;I=0;J=0;K=p;L=o}}else{H=m;I=0;J=0;K=0;L=o}}else{H=k+20|0;I=0;J=0;K=0;L=0}M=9949;N=k+32|0;O=k+44|0;P=k+56|0;Q=H;R=L;S=K;T=J;U=I;V=0}while(0);if((z|0)==89){c[k+52>>2]=l;if(!g){M=0;N=s;O=r;P=q;Q=t;R=w;S=v;T=x;U=u;V=y}else{y=(l|0)==0;u=(f|0)!=0;x=(l|0)!=0;v=f>>>0<l>>>0;w=l+1|0;z=0;I=0;J=0;K=0;while(1){L=J;J=e+(B(K,l)|0)|0;H=(L|0)==0;h=z;i=I;o=0;do{m=c[k+(o*12|0)>>2]|0;a:do switch((o&255)<<24>>24){case 0:{if(!y){p=0;do{a[m+p>>0]=a[J+p>>0]|0;p=p+1|0}while((p|0)!=(l|0))}break}case 1:{if(H){if(u){p=0;do{a[m+p>>0]=a[J+p>>0]|0;p=p+1|0}while((p|0)!=(f|0))}if(!v)break a;p=f;do{a[m+p>>0]=(d[J+p>>0]|0)-(d[J+(p-f)>>0]|0);p=p+1|0}while((p|0)!=(l|0))}else{if(u){p=0;do{a[m+p>>0]=a[J+p>>0]|0;p=p+1|0}while((p|0)!=(f|0))}if(!v)break a;p=f;do{a[m+p>>0]=(d[J+p>>0]|0)-(d[J+(p-f)>>0]|0);p=p+1|0}while((p|0)!=(l|0))}break}case 2:{if(H){if(!x)break a;p=0;do{a[m+p>>0]=a[J+p>>0]|0;p=p+1|0}while((p|0)!=(l|0))}else{if(!x)break a;p=0;do{a[m+p>>0]=(d[J+p>>0]|0)-(d[L+p>>0]|0);p=p+1|0}while((p|0)!=(l|0))}break}case 3:{if(H){if(u){p=0;do{a[m+p>>0]=a[J+p>>0]|0;p=p+1|0}while((p|0)!=(f|0))}if(!v)break a;p=f;do{a[m+p>>0]=(d[J+p>>0]|0)-((d[J+(p-f)>>0]|0)>>>1&255);p=p+1|0}while((p|0)!=(l|0))}else{if(u){p=0;do{a[m+p>>0]=(d[J+p>>0]|0)-((d[L+p>>0]|0)>>>1&255);p=p+1|0}while((p|0)!=(f|0))}if(!v)break a;p=f;do{a[m+p>>0]=(d[J+p>>0]|0)-(((d[L+p>>0]|0)+(d[J+(p-f)>>0]|0)|0)>>>1);p=p+1|0}while((p|0)!=(l|0))}break}case 4:{if(H){if(u){p=0;do{a[m+p>>0]=a[J+p>>0]|0;p=p+1|0}while((p|0)!=(f|0))}if(!v)break a;p=f;do{a[m+p>>0]=(d[J+p>>0]|0)-(d[J+(p-f)>>0]|0);p=p+1|0}while((p|0)!=(l|0))}else{if(u){p=0;do{a[m+p>>0]=(d[J+p>>0]|0)-(d[L+p>>0]|0);p=p+1|0}while((p|0)!=(f|0))}if(!v)break a;p=f;do{C=p-f|0;G=a[J+C>>0]|0;E=a[L+p>>0]|0;A=a[L+C>>0]|0;C=E&255;D=A&255;F=C-D|0;W=(F|0)>-1?F:0-F|0;F=G&255;X=F-D|0;Y=(X|0)>-1?X:0-X|0;X=C+F+(B(D,-2)|0)|0;D=(X|0)>-1?X:0-X|0;a[m+p>>0]=(d[J+p>>0]|0)-(((W|0)>(Y|0)|(W|0)>(D|0)?((Y|0)>(D|0)?A:E):G)&255);p=p+1|0}while((p|0)!=(l|0))}break}default:{}}while(0);p=c[k+(o*12|0)+4>>2]|0;if(!p)Z=0;else{G=0;E=0;while(1){A=E+(d[m+G>>0]|0)|0;G=G+3|0;if(G>>>0>=p>>>0){Z=A;break}else E=A}}E=(o|0)==0|Z>>>0<h>>>0;h=E?Z:h;i=E?o:i;o=o+1|0}while((o|0)!=5);o=B(K,w)|0;a[b+o>>0]=i;if(!y){L=c[k+(i*12|0)>>2]|0;H=0;do{E=H;H=H+1|0;a[b+(H+o)>>0]=a[L+E>>0]|0}while((H|0)!=(l|0))}K=K+1|0;if((K|0)==(g|0))break;else{z=h;I=i}}M=0;N=s;O=r;P=q;Q=t;R=c[k>>2]|0;S=c[k+12>>2]|0;T=c[k+24>>2]|0;U=c[k+36>>2]|0;V=c[k+48>>2]|0}}Hp(R);c[Q>>2]=0;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t:65535;t=u^65535;v=u&255;x=c[o>>2]|0;w=x+1|0;if((c[p>>2]|0)>>>0<w>>>0){A=w<<1;B=Gp(c[b>>2]|0,A)|0;if(B|0){c[p>>2]=A;c[b>>2]=B;C=B;z=12}}else{C=c[b>>2]|0;z=12}if((z|0)==12){z=0;c[o>>2]=w;a[C+x>>0]=v}v=u>>>8&255;u=c[o>>2]|0;x=u+1|0;if((c[p>>2]|0)>>>0<x>>>0){w=x<<1;B=Gp(c[b>>2]|0,w)|0;if(B|0){c[p>>2]=w;c[b>>2]=B;D=B;z=17}}else{D=c[b>>2]|0;z=17}if((z|0)==17){z=0;c[o>>2]=x;a[D+u>>0]=v}v=t&255;u=c[o>>2]|0;x=u+1|0;if((c[p>>2]|0)>>>0<x>>>0){B=x<<1;w=Gp(c[b>>2]|0,B)|0;if(w|0){c[p>>2]=B;c[b>>2]=w;E=w;z=22}}else{E=c[b>>2]|0;z=22}if((z|0)==22){z=0;c[o>>2]=x;a[E+u>>0]=v}v=t>>>8&255;t=c[o>>2]|0;u=t+1|0;if((c[p>>2]|0)>>>0<u>>>0){x=u<<1;w=Gp(c[b>>2]|0,x)|0;if(w|0){c[p>>2]=x;c[b>>2]=w;F=w;z=27}}else{F=c[b>>2]|0;z=27}if((z|0)==27){z=0;c[o>>2]=u;a[F+t>>0]=v}if(r>>>0<f>>>0){v=0;t=r;while(1){u=t+1|0;w=a[e+t>>0]|0;x=c[o>>2]|0;B=x+1|0;if((c[p>>2]|0)>>>0<B>>>0){A=B<<1;G=Gp(c[b>>2]|0,A)|0;if(G|0){c[p>>2]=A;c[b>>2]=G;H=G;z=34}}else{H=c[b>>2]|0;z=34}if((z|0)==34){z=0;c[o>>2]=B;a[H+x>>0]=w}v=v+1|0;if(!(v>>>0<65535&u>>>0<f>>>0)){I=u;break}else t=u}}else I=r;if(s){J=0;break}else{q=q+1|0;r=I}}Fa=h;return J|0}case 1:{c[k>>2]=0;K=i;L=K+36|0;do{c[K>>2]=0;K=K+4|0}while((K|0)<(L|0));K=j;L=K+36|0;do{c[K>>2]=0;K=K+4|0}while((K|0)<(L|0));Zo(i);_o(j);I=b+4|0;r=c[I>>2]|0;q=r+1|0;H=b+8|0;if((c[H>>2]|0)>>>0<q>>>0){o=q<<1;p=Gp(c[b>>2]|0,o)|0;if(!p)M=b;else{c[H>>2]=o;c[b>>2]=p;N=b;O=p;z=41}}else{N=b;O=c[b>>2]|0;z=41}if((z|0)==41){c[I>>2]=q;a[O+r>>0]=0;M=N}N=(c[M>>2]|0)+((c[I>>2]|
|
||
|
function tj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=b+112|0;e=c[d>>2]|0;if((e|0)>0){f=c[b+8>>2]|0;g=0-e|0;h=f+(g<<3)|0;if((c[f+(g<<3)+4>>2]|0)==3){i=c[h>>2]|0;j=e}else{g=qd(h)|0;i=g;j=c[d>>2]|0}g=i>>16;if((j|0)>1){c[524978]=(c[524978]|0)+-2;k=g;l=j}else{k=g;l=j}}else{k=0;l=e}e=b+8|0;b=0;j=l;do{l=b;b=b+1|0;do if((j|0)>(b|0)){g=(c[e>>2]|0)+(0-j<<3)+(b<<3)|0;if((c[g+4>>2]|0)==3){m=c[g>>2]|0;break}else{m=qd(g)|0;break}}else m=0;while(0);g=(l<<2)+k|0;if((g+-24576|0)>>>0<8189){i=(c[(c[704852]|0)+12>>2]|0)+((g<<1)+-49152)|0;a[i>>0]=m&15;h=i+1|0;a[h>>0]=m>>>4&15;i=h+1|0;a[i>>0]=m>>>8&15;h=i+1|0;a[h>>0]=m>>>12&15;i=h+1|0;a[i>>0]=m>>>16&15;h=i+1|0;a[h>>0]=m>>>20&15;i=h+1|0;a[i>>0]=m>>>24&15;a[i+1>>0]=m>>>28}else{uk(2819376,c[743521]|0,g,m&255);uk(2819376,c[743521]|0,g+1|0,m>>>8&255);uk(2819376,c[743521]|0,g+2|0,m>>>16&255);uk(2819376,c[743521]|0,g+3|0,m>>>24)}j=c[d>>2]|0;g=(j|0)<8193?j+-1|0:8192}while(b>>>0<((g|0)>1?g:1)>>>0);return 0}function uj(a){a=a|0;var b=0,d=0;b=c[704845]|0;d=Su(b|0,((b|0)<0)<<31>>31|0,16)|0;b=Nu(d|0,G()|0,60,0)|0;G()|0;yd(a,b);return 1}function vj(a){a=a|0;xd(a);return 1}function wj(a){a=a|0;if(!(c[525002]|0))cb(60104,2e3);c[525002]=1;xd(a);return 1}function xj(a){a=a|0;if(!(c[525001]|0))cb(60073,2e3);c[525001]=1;xd(a);yd(a,0);return 2}function yj(a){a=a|0;xd(a);yd(a,0);return 2}function zj(a){a=a|0;return 0}function Aj(a){a=a|0;c[759980]=1;Uj(a,0);return 1}function Bj(a){a=a|0;c[759980]=1;Uj(a,1);return 1}function Cj(b){b=b|0;var c=0,d=0,e=0;c=pd(b,1,0)|0;d=c>>16;e=td(b,2,0)|0;if(!e){a[2973694+(d<<6)>>0]=0;return 0}if((c+-65536|0)>>>0>327679)return 0;nu(2973694+(d<<6)|0,e,16)|0;return 0}function Dj(a){a=a|0;var b=0,d=0,e=0,f=0;b=Fa;Fa=Fa+16|0;d=b;c[d>>2]=255;if((jd(a)|0)>0?(e=td(a,1,d)|0,(e|0)!=0):0){Fd(a,(vl(e)|0)==0&1);f=1}else f=0;Fa=b;return f|0}function Ej(b){b=b|0;var d=0,e=0;d=pd(b,1,0)|0;if(!(a[2964308]|0)){yb(60043)|0;e=0;return e|0}if(d>>>0>4194303){yd(b,0);e=1;return e|0}else{yd(b,c[2965332+(d>>16<<2)>>2]|0);e=1;return e|0}return 0}function Fj(b){b=b|0;var d=0,e=0;d=pd(b,1,0)|0;e=pd(b,2,0)|0;if(!(a[2964308]|0)){yb(60013)|0;return 0}if(d>>>0>4194303)return 0;b=2965332+(d>>16<<2)|0;if((c[b>>2]|0)!=(e|0))c[759981]=1;c[b>>2]=e;return 0}function Gj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=Fa;Fa=Fa+112|0;e=d+64|0;f=d+108|0;g=d+104|0;h=d+100|0;i=d+72|0;j=d;Vg(16);a:do if((jd(b)|0)>0){k=(pd(b,1,0)|0)>>16;switch(k|0){case 1:{l=4;break a;break}case 0:{$e(c[524986]|0,2,0)|0;m=(c[759908]|0)+(c[742570]|0)|0;n=((m|0)<2097152?m:2097152)<<6;o=0;p=(n|0)>0?n:0;l=15;break a;break}case 2:{q=2;r=Hg(Bg(1)|0)|0;l=93;break a;break}default:{n=(k|0)==3?c[760447]<<16:0;switch(k|0){case 5:{q=k;r=2097152;l=93;break a;break}case 4:{tr();m=c[416461]|0;if(!m){zd(b,3042456,0)|0;Fa=d;return 1}else{s=Fp((ft(m)|0)+16|0)|0;Hr(c[416461]|0,s)|0;zd(b,s,ft(s)|0)|0;Hp(s);Fa=d;return 1}break}case 6:{s=ft(2971644)|0;zd(b,2971644,s>>>0<1024?s:1024)|0;Fa=d;return 1}case 7:{q=7;r=c[759972]<<16;l=93;break a;break}case 9:{q=9;r=(Gq()|0)<<16;l=93;break a;break}case 11:{q=11;r=(jk()|0)<<16;l=93;break a;break}case 13:{rb();q=13;r=4128768-((((c[416457]<<3)+8|0)/2|0)<<16)|0;l=93;break a;break}default:{o=k;p=n;l=15;break a}}}}}else l=4;while(0);if((l|0)==4){o=1;p=Hg(Bg(0)|0)|0;l=15}b:do if((l|0)==15)switch(o|0){case 12:{q=o;r=1507328;l=93;break b;break}case 14:{q=o;r=6815744;l=93;break b;break}case 15:{rb();t=((((c[416457]<<3)+8|0)/2|0)<<16)+4194304|0;break b;break}default:{n=(o|0)==10?c[759910]<<16:(o|0)==8?c[759973]<<16:p;k=o&-4;if((k|0)==16){s=kq(o+-16|0)|0;m=c[743521]|0;u=0;v=-65536;do{v=(s|0)==(m+12+(u*660|0)|0)?u<<16:v;u=u+1|0}while((u|0)!=64);if((v|0)==-65536){u=kq(o+-12|0)|0;m=c[743521]|0;s=0;w=-65536;while(1){x=(u|0)==(m+12+(s*660|0)|0)?s<<16:w;s=s+1|0;if((s|0)==64){y=x;break}else w=x}}else y=v}else y=n;do if((k|0)==20){w=kq(o+-20|0)|0;if(!w){s=kq(o+-16|0)|0;if(!s){z=-65536;break}else A=s}else A=w;z=(jq(A)|0)<<16}else z=y;while(0);switch(o|0){case 24:{k=c[525578]<<16;n=(vq()|0)==0;t=n?-65536:k;break b;break}case 25:{k=c[525577]<<16;n=(vq()
|
||
|
function Fn(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,C=0,D=0,E=0,F=0,G=0,H=0;a=Fa;Fa=Fa+16|0;b=a+8|0;d=a+4|0;e=a;f=c[526415]|0;if(!f){Fa=a;return}if(!(c[f+16>>2]|0)){Fa=a;return}fr(b,d,e);f=(c[b>>2]|0)-(c[526416]|0)|0;g=B(f,f)|0;f=(c[d>>2]|0)-(c[526417]|0)|0;h=(B(f,f)|0)+g|0;Zp();g=c[526415]|0;f=c[g+16>>2]|0;i=(f|0)>0;a:do if(i){j=c[b>>2]|0;k=c[d>>2]|0;l=c[g>>2]|0;m=c[g+8>>2]|0;n=c[l+(c[m>>2]<<2)>>2]|0;o=c[n+4>>2]|0;if(((j|0)>=(o|0)?(j|0)<((c[n+12>>2]|0)+o|0):0)?(o=c[n+8>>2]|0,(k|0)>=(o|0)):0)p=(k|0)<((c[n+16>>2]|0)+o|0)?n:0;else p=0;if((f|0)>1){n=1;o=p;while(1){q=c[l+(c[m+(n<<2)>>2]<<2)>>2]|0;r=c[q+4>>2]|0;do if((((j|0)>=(r|0)?(j|0)<((c[q+12>>2]|0)+r|0):0)?(s=c[q+8>>2]|0,(k|0)>=(s|0)):0)?(k|0)<((c[q+16>>2]|0)+s|0):0){if(o|0?c[o+20>>2]&32|0:0){t=o;break}t=q}else t=o;while(0);n=n+1|0;if((n|0)>=(f|0))break;else o=t}if(i)u=t;else break}else u=p;o=u+20|0;n=u+28|0;k=u+28|0;j=u+28|0;m=u+28|0;l=u+24|0;q=u+24|0;r=h;s=f;v=g;while(1){w=s+-1|0;x=c[(c[v>>2]|0)+(c[(c[v+8>>2]|0)+(w<<2)>>2]<<2)>>2]|0;if((x|0)==(u|0)){y=c[e>>2]|0;z=c[o>>2]|0;A=z&2;if(!y){if(!A)Ra[c[n>>2]&0](u,c[b>>2]|0,c[d>>2]|0,0,3)}else if(!(c[526418]|A)){c[o>>2]=z|2;Ra[c[j>>2]&0](u,c[b>>2]|0,c[d>>2]|0,y,4);y=_q()|0;if((y-(c[526419]|0)|0)<400?(y=(c[c[l>>2]>>2]|0)/64|0,(r|0)<(B(y,y)|0)):0)Ra[c[j>>2]&0](u,c[b>>2]|0,c[d>>2]|0,c[e>>2]|0,18);y=_q()|0;if((y-(c[526420]|0)|0)<400?(y=(c[c[q>>2]>>2]|0)/64|0,(r|0)<(B(y,y)|0)):0){Ra[c[j>>2]&0](u,c[b>>2]|0,c[d>>2]|0,c[e>>2]|0,11);c[526419]=_q()|0}c[526420]=_q()|0;c[526416]=c[b>>2];c[526417]=c[d>>2]}y=c[o>>2]|0;if(!(y&1)){c[o>>2]=y|1;Ra[c[k>>2]&0](u,c[b>>2]|0,c[d>>2]|0,c[e>>2]|0,1)}y=c[525558]|0;z=c[525559]|0;if(z|y|0){Ra[c[m>>2]&0](u,y,z,c[e>>2]|0,16);c[525558]=0;c[525559]=0}}else{z=x+20|0;y=c[z>>2]|0;if(!(y&1))C=y;else{c[z>>2]=y&-2;Ra[c[x+28>>2]&0](x,c[b>>2]|0,c[d>>2]|0,c[e>>2]|0,2);C=c[z>>2]|0}c[z>>2]=C&-33}z=x+20|0;y=c[z>>2]|0;if((y&2|0)==0|(c[e>>2]|0)!=0)if((y&1|0)!=0&(c[525566]|0)!=0?(A=_q()|0,(A|0)<((c[525567]|0)+500|0)):0){A=c[525566]|0;c[526418]=A;D=x+28|0;Ra[c[D>>2]&0](x,c[b>>2]|0,c[d>>2]|0,A,12);A=(c[b>>2]|0)-(c[526421]|0)|0;E=B(A,A)|0;A=(c[d>>2]|0)-(c[526422]|0)|0;F=(B(A,A)|0)+E|0;E=_q()|0;if((E-(c[526423]|0)|0)<400&F>>>0<400)Ra[c[D>>2]&0](x,c[b>>2]|0,c[d>>2]|0,c[526418]|0,15);c[526423]=_q()|0;c[526421]=c[b>>2];c[526422]=c[d>>2];G=F}else G=r;else{c[z>>2]=y&-3;y=x+28|0;Ra[c[y>>2]&0](x,c[b>>2]|0,c[d>>2]|0,0,6);F=_q()|0;if((r|0)<400&(F-(c[526420]|0)|0)<400)Ra[c[y>>2]&0](x,c[b>>2]|0,c[d>>2]|0,c[526418]|0,12);F=(c[b>>2]|0)-(c[526421]|0)|0;D=B(F,F)|0;F=(c[d>>2]|0)-(c[526422]|0)|0;E=(B(F,F)|0)+D|0;D=_q()|0;if((D-(c[526423]|0)|0)<400&E>>>0<400)Ra[c[y>>2]&0](x,c[b>>2]|0,c[d>>2]|0,c[526418]|0,15);c[526423]=_q()|0;c[526421]=c[b>>2];c[526422]=c[d>>2];G=E}E=c[z>>2]|0;y=c[e>>2]|0;if((E&2|0)!=0&(y|0)!=0){Ra[c[x+28>>2]&0](x,c[b>>2]|0,c[d>>2]|0,y,5);H=c[z>>2]|0}else H=E;if(H&1|0?!((c[526424]|0)==0|(c[e>>2]|0)!=0):0)Ra[c[x+28>>2]&0](x,c[b>>2]|0,c[d>>2]|0,0,17);if((s|0)<=1)break a;r=G;s=w;v=c[526415]|0}}while(0);c[525566]=0;G=c[e>>2]|0;c[526418]=G;c[526424]=G;_p();Fa=a;return}function Gn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=Fa;Fa=Fa+16|0;e=d+8|0;f=d+4|0;g=d;if(!(c[526415]|0)){Fa=d;return}fr(e,f,g);h=c[526415]|0;if((c[h+16>>2]|0)<=0){Fa=d;return}if(!b){i=0;j=h;do{k=c[(c[j>>2]|0)+(c[(c[j+8>>2]|0)+(i<<2)>>2]<<2)>>2]|0;Ra[c[k+28>>2]&0](k,c[e>>2]|0,c[f>>2]|0,c[g>>2]|0,a);i=i+1|0;j=c[526415]|0}while((i|0)<(c[j+16>>2]|0));Fa=d;return}j=0;i=h;while(1){h=c[(c[i>>2]|0)+(c[(c[i+8>>2]|0)+(j<<2)>>2]<<2)>>2]|0;if((c[h>>2]|0)==(b|0)){Ra[c[h+28>>2]&0](h,c[e>>2]|0,c[f>>2]|0,c[g>>2]|0,a);l=c[526415]|0}else l=i;j=j+1|0;if((j|0)>=(c[l+16>>2]|0))break;else i=l}Fa=d;return}function Hn(a){a=a|0;var b=0,d=0;b=c[526415]|0;if((a|0)<0|(b|0)==0){d=0;return d|0}if((c[b+20>>2]|0)<=(a|0)){d=0;return d|0}d=c[(c[b>>2]|0)+(a<<2)>>2]|0;return d|0}function In(){var a=0,b=0,d=0,e=0,f=0;a=c[526415]|0;b=c[a+16>>2]|0;if((b|0)<=0){d=-1;return d|0}e=c[a>>2]|0;a=b;while(1){b=a;a=a+-1|0;if(c[(c[e+(a<<2)>>2]|0)+20>>2]&1|0){d=a;f=5;break}if((b|0)<=1){d=-1;f=5;break}}if((f|0)==5)return d|0;retu
|
||
|
function $r(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;d=a+b|0;e=c[a+4>>2]|0;do if(!(e&1)){f=c[a>>2]|0;if(!(e&3))return;g=a+(0-f)|0;h=f+b|0;if((c[760469]|0)==(g|0)){i=d+4|0;j=c[i>>2]|0;if((j&3|0)!=3){k=g;l=h;break}c[760466]=h;c[i>>2]=j&-2;c[g+4>>2]=h|1;c[d>>2]=h;return}j=f>>>3;if(f>>>0<256){f=c[g+8>>2]|0;i=c[g+12>>2]|0;if((i|0)==(f|0)){c[760464]=c[760464]&~(1<<j);k=g;l=h;break}else{c[f+12>>2]=i;c[i+8>>2]=f;k=g;l=h;break}}f=c[g+24>>2]|0;i=c[g+12>>2]|0;do if((i|0)==(g|0)){j=g+16|0;m=j+4|0;n=c[m>>2]|0;if(!n){o=c[j>>2]|0;if(!o){p=0;break}else{q=o;r=j}}else{q=n;r=m}m=q;n=r;while(1){j=m+20|0;o=c[j>>2]|0;if(!o){s=m+16|0;t=c[s>>2]|0;if(!t)break;else{u=t;v=s}}else{u=o;v=j}m=u;n=v}c[n>>2]=0;p=m}else{j=c[g+8>>2]|0;c[j+12>>2]=i;c[i+8>>2]=j;p=i}while(0);if(f){i=c[g+28>>2]|0;j=3042160+(i<<2)|0;if((c[j>>2]|0)==(g|0)){c[j>>2]=p;if(!p){c[760465]=c[760465]&~(1<<i);k=g;l=h;break}}else{i=f+16|0;c[((c[i>>2]|0)==(g|0)?i:f+20|0)>>2]=p;if(!p){k=g;l=h;break}}c[p+24>>2]=f;i=g+16|0;j=c[i>>2]|0;if(j|0){c[p+16>>2]=j;c[j+24>>2]=p}j=c[i+4>>2]|0;if(j){c[p+20>>2]=j;c[j+24>>2]=p;k=g;l=h}else{k=g;l=h}}else{k=g;l=h}}else{k=a;l=b}while(0);b=d+4|0;a=c[b>>2]|0;if(!(a&2)){if((c[760470]|0)==(d|0)){p=(c[760467]|0)+l|0;c[760467]=p;c[760470]=k;c[k+4>>2]=p|1;if((k|0)!=(c[760469]|0))return;c[760469]=0;c[760466]=0;return}if((c[760469]|0)==(d|0)){p=(c[760466]|0)+l|0;c[760466]=p;c[760469]=k;c[k+4>>2]=p|1;c[k+p>>2]=p;return}p=(a&-8)+l|0;v=a>>>3;do if(a>>>0<256){u=c[d+8>>2]|0;r=c[d+12>>2]|0;if((r|0)==(u|0)){c[760464]=c[760464]&~(1<<v);break}else{c[u+12>>2]=r;c[r+8>>2]=u;break}}else{u=c[d+24>>2]|0;r=c[d+12>>2]|0;do if((r|0)==(d|0)){q=d+16|0;e=q+4|0;j=c[e>>2]|0;if(!j){i=c[q>>2]|0;if(!i){w=0;break}else{x=i;y=q}}else{x=j;y=e}e=x;j=y;while(1){q=e+20|0;i=c[q>>2]|0;if(!i){o=e+16|0;s=c[o>>2]|0;if(!s)break;else{z=s;A=o}}else{z=i;A=q}e=z;j=A}c[j>>2]=0;w=e}else{m=c[d+8>>2]|0;c[m+12>>2]=r;c[r+8>>2]=m;w=r}while(0);if(u|0){r=c[d+28>>2]|0;h=3042160+(r<<2)|0;if((c[h>>2]|0)==(d|0)){c[h>>2]=w;if(!w){c[760465]=c[760465]&~(1<<r);break}}else{r=u+16|0;c[((c[r>>2]|0)==(d|0)?r:u+20|0)>>2]=w;if(!w)break}c[w+24>>2]=u;r=d+16|0;h=c[r>>2]|0;if(h|0){c[w+16>>2]=h;c[h+24>>2]=w}h=c[r+4>>2]|0;if(h|0){c[w+20>>2]=h;c[h+24>>2]=w}}}while(0);c[k+4>>2]=p|1;c[k+p>>2]=p;if((k|0)==(c[760469]|0)){c[760466]=p;return}else B=p}else{c[b>>2]=a&-2;c[k+4>>2]=l|1;c[k+l>>2]=l;B=l}l=B>>>3;if(B>>>0<256){a=3041896+(l<<1<<2)|0;b=c[760464]|0;p=1<<l;if(!(b&p)){c[760464]=b|p;C=a;D=a+8|0}else{p=a+8|0;C=c[p>>2]|0;D=p}c[D>>2]=k;c[C+12>>2]=k;c[k+8>>2]=C;c[k+12>>2]=a;return}a=B>>>8;if(a)if(B>>>0>16777215)E=31;else{C=(a+1048320|0)>>>16&8;D=a<<C;a=(D+520192|0)>>>16&4;p=D<<a;D=(p+245760|0)>>>16&2;b=14-(a|C|D)+(p<<D>>>15)|0;E=B>>>(b+7|0)&1|b<<1}else E=0;b=3042160+(E<<2)|0;c[k+28>>2]=E;c[k+20>>2]=0;c[k+16>>2]=0;D=c[760465]|0;p=1<<E;if(!(D&p)){c[760465]=D|p;c[b>>2]=k;c[k+24>>2]=b;c[k+12>>2]=k;c[k+8>>2]=k;return}p=c[b>>2]|0;a:do if((c[p+4>>2]&-8|0)==(B|0))F=p;else{b=B<<((E|0)==31?0:25-(E>>>1)|0);D=p;while(1){G=D+16+(b>>>31<<2)|0;C=c[G>>2]|0;if(!C)break;if((c[C+4>>2]&-8|0)==(B|0)){F=C;break a}else{b=b<<1;D=C}}c[G>>2]=k;c[k+24>>2]=D;c[k+12>>2]=k;c[k+8>>2]=k;return}while(0);G=F+8|0;B=c[G>>2]|0;c[B+12>>2]=k;c[G>>2]=k;c[k+8>>2]=B;c[k+12>>2]=F;c[k+24>>2]=0;return}function as(a){a=a|0;var b=0,d=0;b=Fa;Fa=Fa+16|0;d=b;c[d>>2]=fs(c[a+60>>2]|0)|0;a=ds(ea(6,d|0)|0)|0;Fa=b;return a|0}function bs(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;f=Fa;Fa=Fa+32|0;g=f+16|0;h=f;c[h>>2]=d;i=h+4|0;j=b+48|0;k=c[j>>2]|0;c[i>>2]=e-((k|0)!=0&1);l=b+44|0;c[h+8>>2]=c[l>>2];c[h+12>>2]=k;c[g>>2]=c[b+60>>2];c[g+4>>2]=h;c[g+8>>2]=2;h=ds(Z(145,g|0)|0)|0;if((h|0)>=1){g=c[i>>2]|0;if(h>>>0>g>>>0){i=c[l>>2]|0;l=b+4|0;c[l>>2]=i;k=i;c[b+8>>2]=k+(h-g);if(!(c[j>>2]|0))m=e;else{c[l>>2]=k+1;a[d+(e+-1)>>0]=a[k>>0]|0;m=e}}else m=h}else{c[b>>2]=c[b>>2]|h&48^16;m=h}Fa=f;return m|0}function cs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=Fa;Fa=Fa+32|0;f=e;g=e+20|0;c[f>>2]=c[a+60>>2];c[f+4>>2]=0;c[f+8>>2]=b;c[f+12>>2]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[ov,bb,Ul,Vl,or,ov,ov,ov];var Pa=[pv,zm,hc,Od,Sd,vf,Qf,Rf];var Qa=[qv,$a,nr,qv];var Ra=[rv];return{___divdi3:Nu,___emscripten_environ_constructor:Eu,___errno_location:es,___muldi3:Pu,___udivdi3:Qu,__get_daylight:Gu,__get_environ:Iu,__get_timezone:Hu,__get_tzname:Fu,_bitshift64Lshr:Ru,_bitshift64Shl:Su,_codo_mixer_callback:Qp,_free:Xr,_i64Add:Ju,_i64Subtract:Ku,_llvm_bswap_i32:Tu,_main:Db,_malloc:Wr,_memcpy:Xu,_memset:Yu,_mix_0:Mq,_realloc:Zr,_saveSetjmp:Uu,_sbrk:Zu,_setThrew:Wu,_testSetjmp:Vu,dynCall_i:_u,dynCall_ii:$u,dynCall_iii:av,dynCall_iiii:bv,dynCall_iiiii:cv,dynCall_v:dv,dynCall_vi:ev,dynCall_vii:fv,dynCall_viii:gv,dynCall_viiiii:hv,establishStackSpace:Va,stackAlloc:Sa,stackRestore:Ua,stackSave:Ta}})
|
||
|
|
||
|
|
||
|
// EMSCRIPTEN_END_ASM
|
||
|
(asmGlobalArg, asmLibraryArg, buffer);
|
||
|
|
||
|
var ___divdi3 = Module["___divdi3"] = asm["___divdi3"];
|
||
|
|
||
|
var ___emscripten_environ_constructor = Module["___emscripten_environ_constructor"] = asm["___emscripten_environ_constructor"];
|
||
|
|
||
|
var ___errno_location = Module["___errno_location"] = asm["___errno_location"];
|
||
|
|
||
|
var ___muldi3 = Module["___muldi3"] = asm["___muldi3"];
|
||
|
|
||
|
var ___udivdi3 = Module["___udivdi3"] = asm["___udivdi3"];
|
||
|
|
||
|
var __get_daylight = Module["__get_daylight"] = asm["__get_daylight"];
|
||
|
|
||
|
var __get_environ = Module["__get_environ"] = asm["__get_environ"];
|
||
|
|
||
|
var __get_timezone = Module["__get_timezone"] = asm["__get_timezone"];
|
||
|
|
||
|
var __get_tzname = Module["__get_tzname"] = asm["__get_tzname"];
|
||
|
|
||
|
var _bitshift64Lshr = Module["_bitshift64Lshr"] = asm["_bitshift64Lshr"];
|
||
|
|
||
|
var _bitshift64Shl = Module["_bitshift64Shl"] = asm["_bitshift64Shl"];
|
||
|
|
||
|
var _codo_mixer_callback = Module["_codo_mixer_callback"] = asm["_codo_mixer_callback"];
|
||
|
|
||
|
var _free = Module["_free"] = asm["_free"];
|
||
|
|
||
|
var _i64Add = Module["_i64Add"] = asm["_i64Add"];
|
||
|
|
||
|
var _i64Subtract = Module["_i64Subtract"] = asm["_i64Subtract"];
|
||
|
|
||
|
var _llvm_bswap_i32 = Module["_llvm_bswap_i32"] = asm["_llvm_bswap_i32"];
|
||
|
|
||
|
var _main = Module["_main"] = asm["_main"];
|
||
|
|
||
|
var _malloc = Module["_malloc"] = asm["_malloc"];
|
||
|
|
||
|
var _memcpy = Module["_memcpy"] = asm["_memcpy"];
|
||
|
|
||
|
var _memset = Module["_memset"] = asm["_memset"];
|
||
|
|
||
|
var _mix_0 = Module["_mix_0"] = asm["_mix_0"];
|
||
|
|
||
|
var _realloc = Module["_realloc"] = asm["_realloc"];
|
||
|
|
||
|
var _saveSetjmp = Module["_saveSetjmp"] = asm["_saveSetjmp"];
|
||
|
|
||
|
var _sbrk = Module["_sbrk"] = asm["_sbrk"];
|
||
|
|
||
|
var _setThrew = Module["_setThrew"] = asm["_setThrew"];
|
||
|
|
||
|
var _testSetjmp = Module["_testSetjmp"] = asm["_testSetjmp"];
|
||
|
|
||
|
var establishStackSpace = Module["establishStackSpace"] = asm["establishStackSpace"];
|
||
|
|
||
|
var stackAlloc = Module["stackAlloc"] = asm["stackAlloc"];
|
||
|
|
||
|
var stackRestore = Module["stackRestore"] = asm["stackRestore"];
|
||
|
|
||
|
var stackSave = Module["stackSave"] = asm["stackSave"];
|
||
|
|
||
|
var dynCall_i = Module["dynCall_i"] = asm["dynCall_i"];
|
||
|
|
||
|
var dynCall_ii = Module["dynCall_ii"] = asm["dynCall_ii"];
|
||
|
|
||
|
var dynCall_iii = Module["dynCall_iii"] = asm["dynCall_iii"];
|
||
|
|
||
|
var dynCall_iiii = Module["dynCall_iiii"] = asm["dynCall_iiii"];
|
||
|
|
||
|
var dynCall_iiiii = Module["dynCall_iiiii"] = asm["dynCall_iiiii"];
|
||
|
|
||
|
var dynCall_v = Module["dynCall_v"] = asm["dynCall_v"];
|
||
|
|
||
|
var dynCall_vi = Module["dynCall_vi"] = asm["dynCall_vi"];
|
||
|
|
||
|
var dynCall_vii = Module["dynCall_vii"] = asm["dynCall_vii"];
|
||
|
|
||
|
var dynCall_viii = Module["dynCall_viii"] = asm["dynCall_viii"];
|
||
|
|
||
|
var dynCall_viiiii = Module["dynCall_viiiii"] = asm["dynCall_viiiii"];
|
||
|
|
||
|
Module["asm"] = asm;
|
||
|
|
||
|
Module["ccall"] = ccall;
|
||
|
|
||
|
Module["getValue"] = getValue;
|
||
|
|
||
|
Module["getMemory"] = getMemory;
|
||
|
|
||
|
Module["addRunDependency"] = addRunDependency;
|
||
|
|
||
|
Module["removeRunDependency"] = removeRunDependency;
|
||
|
|
||
|
Module["FS_createFolder"] = FS.createFolder;
|
||
|
|
||
|
Module["FS_createPath"] = FS.createPath;
|
||
|
|
||
|
Module["FS_createDataFile"] = FS.createDataFile;
|
||
|
|
||
|
Module["FS_createPreloadedFile"] = FS.createPreloadedFile;
|
||
|
|
||
|
Module["FS_createLazyFile"] = FS.createLazyFile;
|
||
|
|
||
|
Module["FS_createLink"] = FS.createLink;
|
||
|
|
||
|
Module["FS_createDevice"] = FS.createDevice;
|
||
|
|
||
|
Module["FS_unlink"] = FS.unlink;
|
||
|
|
||
|
if (memoryInitializer) {
|
||
|
if (!isDataURI(memoryInitializer)) {
|
||
|
memoryInitializer = locateFile(memoryInitializer);
|
||
|
}
|
||
|
if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
|
||
|
var data = Module["readBinary"](memoryInitializer);
|
||
|
HEAPU8.set(data, GLOBAL_BASE);
|
||
|
} else {
|
||
|
addRunDependency("memory initializer");
|
||
|
var applyMemoryInitializer = function(data) {
|
||
|
if (data.byteLength) data = new Uint8Array(data);
|
||
|
HEAPU8.set(data, GLOBAL_BASE);
|
||
|
if (Module["memoryInitializerRequest"]) delete Module["memoryInitializerRequest"].response;
|
||
|
removeRunDependency("memory initializer");
|
||
|
};
|
||
|
var doBrowserLoad = function() {
|
||
|
Module["readAsync"](memoryInitializer, applyMemoryInitializer, function() {
|
||
|
throw "could not load memory initializer " + memoryInitializer;
|
||
|
});
|
||
|
};
|
||
|
var memoryInitializerBytes = tryParseAsDataURI(memoryInitializer);
|
||
|
if (memoryInitializerBytes) {
|
||
|
applyMemoryInitializer(memoryInitializerBytes.buffer);
|
||
|
} else if (Module["memoryInitializerRequest"]) {
|
||
|
var useRequest = function() {
|
||
|
var request = Module["memoryInitializerRequest"];
|
||
|
var response = request.response;
|
||
|
if (request.status !== 200 && request.status !== 0) {
|
||
|
var data = tryParseAsDataURI(Module["memoryInitializerRequestURL"]);
|
||
|
if (data) {
|
||
|
response = data.buffer;
|
||
|
} else {
|
||
|
console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: " + request.status + ", retrying " + memoryInitializer);
|
||
|
doBrowserLoad();
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
applyMemoryInitializer(response);
|
||
|
};
|
||
|
if (Module["memoryInitializerRequest"].response) {
|
||
|
setTimeout(useRequest, 0);
|
||
|
} else {
|
||
|
Module["memoryInitializerRequest"].addEventListener("load", useRequest);
|
||
|
}
|
||
|
} else {
|
||
|
doBrowserLoad();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function ExitStatus(status) {
|
||
|
this.name = "ExitStatus";
|
||
|
this.message = "Program terminated with exit(" + status + ")";
|
||
|
this.status = status;
|
||
|
}
|
||
|
|
||
|
ExitStatus.prototype = new Error();
|
||
|
|
||
|
ExitStatus.prototype.constructor = ExitStatus;
|
||
|
|
||
|
var calledMain = false;
|
||
|
|
||
|
dependenciesFulfilled = function runCaller() {
|
||
|
if (!Module["calledRun"]) run();
|
||
|
if (!Module["calledRun"]) dependenciesFulfilled = runCaller;
|
||
|
};
|
||
|
|
||
|
Module["callMain"] = function callMain(args) {
|
||
|
args = args || [];
|
||
|
ensureInitRuntime();
|
||
|
var argc = args.length + 1;
|
||
|
var argv = stackAlloc((argc + 1) * 4);
|
||
|
HEAP32[argv >> 2] = allocateUTF8OnStack(Module["thisProgram"]);
|
||
|
for (var i = 1; i < argc; i++) {
|
||
|
HEAP32[(argv >> 2) + i] = allocateUTF8OnStack(args[i - 1]);
|
||
|
}
|
||
|
HEAP32[(argv >> 2) + argc] = 0;
|
||
|
try {
|
||
|
var ret = Module["_main"](argc, argv, 0);
|
||
|
exit(ret, true);
|
||
|
} catch (e) {
|
||
|
if (e instanceof ExitStatus) {
|
||
|
return;
|
||
|
} else if (e == "SimulateInfiniteLoop") {
|
||
|
Module["noExitRuntime"] = true;
|
||
|
return;
|
||
|
} else {
|
||
|
var toLog = e;
|
||
|
if (e && typeof e === "object" && e.stack) {
|
||
|
toLog = [ e, e.stack ];
|
||
|
}
|
||
|
err("exception thrown: " + toLog);
|
||
|
Module["quit"](1, e);
|
||
|
}
|
||
|
} finally {
|
||
|
calledMain = true;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function run(args) {
|
||
|
args = args || Module["arguments"];
|
||
|
if (runDependencies > 0) {
|
||
|
return;
|
||
|
}
|
||
|
preRun();
|
||
|
if (runDependencies > 0) return;
|
||
|
if (Module["calledRun"]) return;
|
||
|
function doRun() {
|
||
|
if (Module["calledRun"]) return;
|
||
|
Module["calledRun"] = true;
|
||
|
if (ABORT) return;
|
||
|
ensureInitRuntime();
|
||
|
preMain();
|
||
|
if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
|
||
|
if (Module["_main"] && shouldRunNow) Module["callMain"](args);
|
||
|
postRun();
|
||
|
}
|
||
|
if (Module["setStatus"]) {
|
||
|
Module["setStatus"]("Running...");
|
||
|
setTimeout(function() {
|
||
|
setTimeout(function() {
|
||
|
Module["setStatus"]("");
|
||
|
}, 1);
|
||
|
doRun();
|
||
|
}, 1);
|
||
|
} else {
|
||
|
doRun();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Module["run"] = run;
|
||
|
|
||
|
function exit(status, implicit) {
|
||
|
if (implicit && Module["noExitRuntime"] && status === 0) {
|
||
|
return;
|
||
|
}
|
||
|
if (Module["noExitRuntime"]) {} else {
|
||
|
ABORT = true;
|
||
|
EXITSTATUS = status;
|
||
|
exitRuntime();
|
||
|
if (Module["onExit"]) Module["onExit"](status);
|
||
|
}
|
||
|
Module["quit"](status, new ExitStatus(status));
|
||
|
}
|
||
|
|
||
|
function abort(what) {
|
||
|
if (Module["onAbort"]) {
|
||
|
Module["onAbort"](what);
|
||
|
}
|
||
|
if (what !== undefined) {
|
||
|
out(what);
|
||
|
err(what);
|
||
|
what = JSON.stringify(what);
|
||
|
} else {
|
||
|
what = "";
|
||
|
}
|
||
|
ABORT = true;
|
||
|
EXITSTATUS = 1;
|
||
|
throw "abort(" + what + "). Build with -s ASSERTIONS=1 for more info.";
|
||
|
}
|
||
|
|
||
|
Module["abort"] = abort;
|
||
|
|
||
|
if (Module["preInit"]) {
|
||
|
if (typeof Module["preInit"] == "function") Module["preInit"] = [ Module["preInit"] ];
|
||
|
while (Module["preInit"].length > 0) {
|
||
|
Module["preInit"].pop()();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var shouldRunNow = true;
|
||
|
|
||
|
if (Module["noInitialRun"]) {
|
||
|
shouldRunNow = false;
|
||
|
}
|
||
|
|
||
|
Module["noExitRuntime"] = true;
|
||
|
|
||
|
run();
|
||
|
|