TempleOSCD_150720.ISO
This commit is contained in:
1 parent
401601816c
commit
f8c05f98f4
554 files changed
+26046
-24853
No files matched your search
@@ -116,8 +116,8 @@ U0 Init()
|
||||
Cloud *c=clouds;
|
||||
CloudPen *cp=cloud_pens;
|
||||
I64 i,j,k,l,
|
||||
w=Fs->pix_width,
|
||||
h=SKY_LINES*FONT_HEIGHT;
|
||||
w=Fs->pix_width,
|
||||
h=SKY_LINES*FONT_HEIGHT;
|
||||
|
||||
for (i=0;i<NUM_CLOUDS;i++,c++) {
|
||||
c->x=ToI64(w/2+Rand*w/2-w/4)<<32;
|
||||
@@ -162,7 +162,7 @@ U0 CleanUp()
|
||||
U0 SongTask(I64)
|
||||
{//Song by the Holy Spirit
|
||||
//This specifies a callback routine
|
||||
//to be called when the task dies.
|
||||
//to be called when the task dies.
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
MusicSettingsRst;
|
||||
while (TRUE) {
|
||||
@@ -191,7 +191,7 @@ U0 CloudScene()
|
||||
"$$BG,YELLOW$$%h5c",'\n';
|
||||
BibleVerse(,"Exodus,14:19",7);
|
||||
|
||||
Preempt(OFF);
|
||||
Preempt;
|
||||
Fs->draw_it=&DrawIt;
|
||||
GetChar;
|
||||
WinMgrSync;
|
||||
|
||||
@@ -24,8 +24,8 @@ U0 UnlockedInc()
|
||||
glbl=0;
|
||||
tempm0=JobQue(&MPUnlockedInc,NULL,0,0);
|
||||
tempm1=JobQue(&MPUnlockedInc,NULL,1,0);
|
||||
GetResult(tempm0);
|
||||
GetResult(tempm1);
|
||||
JobResultGet(tempm0);
|
||||
JobResultGet(tempm1);
|
||||
"Correct Cnt:%X Actual Cnt:%X\n",CNT*2,glbl;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ U0 MPLockedInc(I64)
|
||||
I64 i;
|
||||
for (i=0;i<CNT;i++)
|
||||
lock //Can be used without {}
|
||||
glbl++;
|
||||
glbl++;
|
||||
}
|
||||
|
||||
U0 LockedInc()
|
||||
@@ -43,8 +43,8 @@ U0 LockedInc()
|
||||
glbl=0;
|
||||
tempm0=JobQue(&MPLockedInc,NULL,0,0);
|
||||
tempm1=JobQue(&MPLockedInc,NULL,1,0);
|
||||
GetResult(tempm0);
|
||||
GetResult(tempm1);
|
||||
JobResultGet(tempm0);
|
||||
JobResultGet(tempm1);
|
||||
"Correct Cnt:%X Actual Cnt:%X\n",CNT*2,glbl;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ I64 mp_n;
|
||||
I64 MPSum(I64 my_mp_cnt)
|
||||
{//We could use the formula n*(n+1)/2
|
||||
I64 lo=mp_n*Gs->num/my_mp_cnt,
|
||||
hi=mp_n*(Gs->num+1)/my_mp_cnt,
|
||||
result=0,i;
|
||||
hi=mp_n*(Gs->num+1)/my_mp_cnt,
|
||||
result=0,i;
|
||||
for (i=lo;i<hi;i++)
|
||||
result+=i;
|
||||
return result;
|
||||
@@ -18,7 +18,7 @@ I64 Sum(I64 n,I64 my_mp_cnt)
|
||||
for (i=0;i<my_mp_cnt;i++)
|
||||
tempm[i]=JobQue(&MPSum,my_mp_cnt,i,0);
|
||||
for (i=0;i<my_mp_cnt;i++)
|
||||
result+=GetResult(tempm[i]);
|
||||
result+=JobResultGet(tempm[i]);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ F64 Test(I64 n,I64 my_mp_cnt)
|
||||
U0 MPAdd()
|
||||
{
|
||||
I64 i,n,
|
||||
h=Fs->pix_width,
|
||||
v=Fs->pix_height;
|
||||
h=Fs->pix_width,
|
||||
v=Fs->pix_height;
|
||||
F64 t1,t2,results[NUM_TESTS];
|
||||
CDC *dc=DCAlias;
|
||||
|
||||
@@ -71,7 +71,7 @@ U0 MPAdd()
|
||||
dc->color=RED;
|
||||
dc->pen_width=2;
|
||||
GrLine3(dc,i*h/(NUM_TESTS-1), v-results[i ]/MAX_PERCENT*v,0,
|
||||
(i+1)*h/(NUM_TESTS-1),v-results[i+1]/MAX_PERCENT*v,0);
|
||||
(i+1)*h/(NUM_TESTS-1),v-results[i+1]/MAX_PERCENT*v,0);
|
||||
dc->color=GREEN;
|
||||
GrPrint(dc,i*h/(NUM_TESTS-1),v-FONT_HEIGHT,"10e%d",i+MIN_TEST);
|
||||
GrLine(dc,i*h/(NUM_TESTS-1),0,i*h/(NUM_TESTS-1),v);
|
||||
|
||||
@@ -7,7 +7,7 @@ CDoc *doc;
|
||||
U0 PDNormalize()
|
||||
{
|
||||
U8 *r=MAlloc(size+2*BORDER_CHARS),
|
||||
*src=buf,*dst=r;
|
||||
*src=buf,*dst=r;
|
||||
I64 ch;
|
||||
*dst++='['; //Border
|
||||
while (size--) {
|
||||
@@ -38,12 +38,12 @@ U0 MPPalindrome(I64 dummy=0)
|
||||
{
|
||||
nounusedwarn dummy;
|
||||
U8 *src=buf+BORDER_CHARS+size*Gs->num/mp_cnt,
|
||||
*f,*b;
|
||||
*f,*b;
|
||||
I64 len,best=0,
|
||||
my_size=(size+mp_cnt-1)/mp_cnt;
|
||||
my_size=(size+mp_cnt-1)/mp_cnt;
|
||||
while (my_size--) {
|
||||
|
||||
//Odd
|
||||
//Odd
|
||||
f=src+1;
|
||||
b=src-1;
|
||||
while (*f==*b) {
|
||||
@@ -56,7 +56,7 @@ U0 MPPalindrome(I64 dummy=0)
|
||||
PDAnswer(src,len);
|
||||
}
|
||||
|
||||
//Even
|
||||
//Even
|
||||
f=src+1;
|
||||
b=src;
|
||||
while (*f==*b) {
|
||||
|
||||
@@ -4,10 +4,10 @@ I64 prime_range,my_mp_cnt,pending;
|
||||
U0 PrimesJob(I64 i)
|
||||
{
|
||||
I64 j,k,l=Sqrt(prime_range),
|
||||
lo=i*prime_range/my_mp_cnt,
|
||||
hi=(i+1)*prime_range/my_mp_cnt,
|
||||
lo2=lo+sys_cache_line_width,
|
||||
hi2=hi-sys_cache_line_width;
|
||||
lo=i*prime_range/my_mp_cnt,
|
||||
hi=(i+1)*prime_range/my_mp_cnt,
|
||||
lo2=lo+sys_cache_line_width,
|
||||
hi2=hi-sys_cache_line_width;
|
||||
if (lo2>hi2) lo2=hi2;
|
||||
for (j=2;j<=l;j++) {
|
||||
if (!Bt(master_bitmap,j)) {
|
||||
@@ -62,8 +62,8 @@ I64 Primes(I64 range,I64 _my_mp_cnt)
|
||||
if (!Bt(master_bitmap,i))
|
||||
"%d ",i;
|
||||
|
||||
"\n$$RED$$CPUs:%d PrimeRange:%,d PrimeCnt:%,d Time:%9.6,f$$FG$$\n",
|
||||
my_mp_cnt,prime_range,prime_cnt,tf-t0;
|
||||
"\n$$RED$$CPUs:%d PrimeRange:%,d PrimeCnt:%,d Time:%9.7,f$$FG$$\n",
|
||||
my_mp_cnt,prime_range,prime_cnt,tf-t0;
|
||||
|
||||
Free(master_bitmap);
|
||||
return prime_cnt;
|
||||
|
||||
@@ -38,7 +38,7 @@ U0 QSortU32(I32 *base,I64 num)
|
||||
i=less-base;
|
||||
if (i==num) {//All less or equal to pivot
|
||||
|
||||
//Point greater to first less
|
||||
//Point greater to first less
|
||||
do greater--;
|
||||
while (--i && *greater==pivot);
|
||||
|
||||
@@ -94,7 +94,7 @@ U0 MPRadixSortDemo(I64 dummy=0)
|
||||
D(a2+NUM/4);
|
||||
|
||||
for (i=0;i<my_mp_cnt;i++) {
|
||||
//$WW,0$We must do full size, just in case.
|
||||
//$WW,0$We must do full size, just in case.
|
||||
//There will be uneven split between cores
|
||||
//depending on the distribution of rand numbers.
|
||||
b[i]=MAlloc(NUM*sizeof(I32));
|
||||
|
||||
Reference in new issue
Block a user