Nightly update (ISO SHA-1 6931795)

This commit is contained in:
TempleOS-bot committed 2017-01-30 21:27:26 -05:00
1 parent 2f8692274e
commit 8088cb942b
10 files changed
+93 -44

No files matched your search

Binary file not shown.
+1 -1
View File
@@ -18,7 +18,7 @@ U0 LoadDocDefines()
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$ //$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
$TR-C,"LineRep"$ $TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,262"); $ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,311");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,012"); DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,012");
$ID,-4$ $ID,-4$
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR); DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
Binary file not shown.
+1 -1
View File
@@ -21,6 +21,7 @@ extern U0 StreamDir();
public extern I64 StreamExePrint(U8 *fmt,...); public extern I64 StreamExePrint(U8 *fmt,...);
public extern U0 StreamPrint(U8 *fmt,...); public extern U0 StreamPrint(U8 *fmt,...);
public extern Bool Trace(Bool val=ON); public extern Bool Trace(Bool val=ON);
#help_index "Compiler/Lex" #help_index "Compiler/Lex"
#help_file "::/Doc/Lex" #help_file "::/Doc/Lex"
extern U0 ClassMemberLstDel(CHashClass *c); extern U0 ClassMemberLstDel(CHashClass *c);
@@ -64,7 +65,6 @@ public extern I64 PrsKeyWord(CCmpCtrl *cc);
#help_index "Compiler;Cmd Line (Typically)" #help_index "Compiler;Cmd Line (Typically)"
extern I64 Cmp(U8 *filename, extern I64 Cmp(U8 *filename,
U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0); U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0);
#help_index "Debugging/Unassemble" #help_index "Debugging/Unassemble"
public extern U8 *U(U8 *rip,I64 cnt=20,I64 seg_size=64); public extern U8 *U(U8 *rip,I64 cnt=20,I64 seg_size=64);
public extern U0 Ui(U8 *buf,U8 **_rip,I64 seg_size=64, public extern U0 Ui(U8 *buf,U8 **_rip,I64 seg_size=64,
+4 -4
View File
@@ -50,7 +50,7 @@ $ID,-2$$TR,"Wenceslas"$
$ID,2$F64 best_score=43.9944; $ID,2$F64 best_score=43.9944;
$ID,-2$$TR,"OSTestSuite"$ $ID,-2$$TR,"OSTestSuite"$
$ID,2$progress1_tf=0.000;progress2_tf=0.000; $ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=227.004; progress3_tf=0.000;progress4_tf=229.523;
$ID,-2$$TR,"XCaliber"$ $ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=90; $ID,2$I64 best_score=90;
I64 msg_flags=2; I64 msg_flags=2;
@@ -62,13 +62,13 @@ $ID,-2$$TR,"Titanium"$
$ID,2$I64 best_score=16469; $ID,2$I64 best_score=16469;
$ID,-2$$TR,"TOSRegen"$ $ID,-2$$TR,"TOSRegen"$
$ID,2$progress1_tf=0.000;progress2_tf=0.000; $ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=203.589; progress3_tf=0.000;progress4_tf=201.797;
$ID,-2$$ID,-2$$TR,"Once"$ $ID,-2$$ID,-2$$TR,"Once"$
$ID,2$$TR,"Adam"$ $ID,2$$TR,"Adam"$
$ID,2$$ID,-2$$TR,"User"$ $ID,2$$ID,-2$$TR,"User"$
$ID,2$$ID,-2$$ID,-2$$TR,"DemoCompany"$ $ID,2$$ID,-2$$ID,-2$$TR,"DemoCompany"$
$ID,2$$TR,"Game1"$ $ID,2$$TR,"Game1"$
$ID,2$F64 best_score=188.69015; $ID,2$F64 best_score=236.35149;
$TR,"SimpleVal"$ $TR,"SimpleVal"$
$ID,2$1236; $ID,2$1237;
$ID,-2$$ID,-2$$ID,-2$ $ID,-2$$ID,-2$$ID,-2$
+81 -32
View File
@@ -7,11 +7,36 @@ class Photon
CDC *map; CDC *map;
F64 ts; F64 ts;
U8 *bmp;
F64 bmp_scale;
I64 bmp_mem,bmp_width,bmp_height;
I64 BmpPeek(I64 x,I64 y)
{
if (0<=x<bmp_width && 0<=y<bmp_height) {
if (Bt(bmp,y*bmp_width+x))
return WHITE;
else
return BLACK;
} else
return -1;
}
U0 BmpPlot(U8 *bmp,I64 x,I64 y,I64)
{
if (0<=x<bmp_width && 0<=y<bmp_height)
Bts(bmp,y*bmp_width+x);
}
#define TAIL 20 #define TAIL 20
U0 DrawIt(CTask *,CDC *dc) U0 DrawIt(CTask *,CDC *dc)
{ {
Photon *tmpp; Photon *tmpp;
GrBlot(dc,0,0,map); GrBlot(dc,0,0,map);
dc->color=WHITE;
GrPrint(dc,0,0,"Mem:0x%X %,dMeg Scale:%0.3f (%d,%d)-->(%d,%d)",
bmp_mem,bmp_mem/1024/1024,bmp_scale,
map->width,map->height,bmp_width,bmp_height);
tmpp=p_root.next; tmpp=p_root.next;
while (tmpp!=&p_root) { while (tmpp!=&p_root) {
dc->color=LTRED; dc->color=LTRED;
@@ -65,30 +90,34 @@ U0 RandomBurst()
} }
} }
#define HEIGHT 10 #define HEIGHT (5*bmp_scale)
U0 FindNormal(CDC *dc,Photon *tmpp,I64 last,I64,CD3 *_normal) U0 FindNormal(Photon *tmpp,I64 last,I64,CD3 *_normal)
{ {
CD3 p1,p2,v,s; CD3 p1,p2,v,s,bmp_p;
F64 é=Arg(tmpp->v.x,tmpp->v.y),è; F64 é=Arg(tmpp->v.x,tmpp->v.y),è;
D3Mul(&bmp_p,bmp_scale,&tmpp->p);
while (BmpPeek(bmp_p.x,bmp_p.y)==last)
D3AddEqu(&bmp_p,&tmpp->v);
for (è=0;è<ã/2;è+=ã/HEIGHT) { for (è=0;è<ã/2;è+=ã/HEIGHT) {
D3Equ(&s,Cos(é+ã-ã/4-è),Sin(é+ã-ã/4-è)); D3Equ(&s,Cos(é+ã-ã/4-è),Sin(é+ã-ã/4-è));
D3Mul(&v,HEIGHT,&s); D3Mul(&v,HEIGHT,&s);
D3Add(&p1,&tmpp->p,&v); D3Add(&p1,&bmp_p,&v);
if (GrPeek(dc,p1.x,p1.y)!=last) if (BmpPeek(p1.x,p1.y)!=BLACK)
break; break;
} }
if (GrPeek(dc,p1.x,p1.y)==last) if (BmpPeek(p1.x,p1.y)!=WHITE)
D3Copy(&p1,&tmpp->p); D3Copy(&p1,&tmpp->p);
for (è=0;è<ã/2;è+=ã/HEIGHT) { for (è=0;è<ã/2;è+=ã/HEIGHT) {
D3Equ(&s,Cos(é+ã+ã/4+è),Sin(é+ã+ã/4+è)); D3Equ(&s,Cos(é+ã+ã/4+è),Sin(é+ã+ã/4+è));
D3Mul(&v,HEIGHT,&s); D3Mul(&v,HEIGHT,&s);
D3Add(&p2,&tmpp->p,&v); D3Add(&p2,&bmp_p,&v);
if (GrPeek(dc,p2.x,p2.y)!=last) if (BmpPeek(p2.x,p2.y)!=BLACK)
break; break;
} }
if (GrPeek(dc,p2.x,p2.y)==last) if (BmpPeek(p2.x,p2.y)!=WHITE)
D3Copy(&p2,&tmpp->p); D3Copy(&p2,&tmpp->p);
D3Sub(&s,&p1,&p2); D3Sub(&s,&p1,&p2);
@@ -99,7 +128,7 @@ U0 FindNormal(CDC *dc,Photon *tmpp,I64 last,I64,CD3 *_normal)
D3Unit(_normal); D3Unit(_normal);
} }
U0 SnellsLaw(CDC *dc,Photon *tmpp,I64 last,I64 next) U0 SnellsLaw(Photon *tmpp,I64 last,I64 next)
{ {
//n1 and n2 are refraction index. //n1 and n2 are refraction index.
//n1 Sin(é1) == n2 Sin(é2) //n1 Sin(é1) == n2 Sin(é2)
@@ -113,7 +142,7 @@ U0 SnellsLaw(CDC *dc,Photon *tmpp,I64 last,I64 next)
n2=1.5; n2=1.5;
else else
n2=1.0; n2=1.0;
FindNormal(dc,tmpp,last,next,&normal); FindNormal(tmpp,last,next,&normal);
én=Arg(normal.x,normal.y); én=Arg(normal.x,normal.y);
//dot=m1m2Cos(é); //dot=m1m2Cos(é);
é1=ACos(D3Dot(&normal,&tmpp->v)); é1=ACos(D3Dot(&normal,&tmpp->v));
@@ -138,15 +167,14 @@ U0 AnimateTask(I64)
while (tmpp!=&p_root) { while (tmpp!=&p_root) {
last=GrPeek(map,tmpp->p.x,tmpp->p.y); last=GrPeek(map,tmpp->p.x,tmpp->p.y);
D3AddEqu(&tmpp->p,&tmpp->v); D3AddEqu(&tmpp->p,&tmpp->v);
if (tmpp->p.x<=0) tmpp->v.x=-tmpp->v.x; if (tmpp->p.x<=0) tmpp->v.x=-tmpp->v.x;
if (tmpp->p.x>=map->width) tmpp->v.x=-tmpp->v.x; if (tmpp->p.x>=map->width) tmpp->v.x=-tmpp->v.x;
if (tmpp->p.y<=0) tmpp->v.y=-tmpp->v.y; if (tmpp->p.y<=0) tmpp->v.y=-tmpp->v.y;
if (tmpp->p.y>=map->height) tmpp->v.y=-tmpp->v.y; if (tmpp->p.y>=map->height) tmpp->v.y=-tmpp->v.y;
next=GrPeek(map,tmpp->p.x,tmpp->p.y); next=GrPeek(map,tmpp->p.x,tmpp->p.y);
if (last!=next && if (last!=next &&
(last==BLACK && next==WHITE) || (last==BLACK && next==WHITE) || (last==WHITE && next==BLACK))
(last==WHITE && next==BLACK)) SnellsLaw(tmpp,last,next);
SnellsLaw(map,tmpp,last,next);
tmpp=tmpp->next; tmpp=tmpp->next;
} }
Sleep(1000*ts); Sleep(1000*ts);
@@ -158,20 +186,30 @@ U0 Init()
ts=0.01; ts=0.01;
map=DCNew(Fs->pix_width,Fs->pix_height); map=DCNew(Fs->pix_width,Fs->pix_height);
QueInit(&p_root); QueInit(&p_root);
//x*y=bmp_mem*8
//x/y=640/480
//x=640/480*y
//640/480*y^2=bmp_mem*8
//y=Sqrt(bmp_mem*8*480/640)
//bmp_scale=Sqrt(bmp_mem*8*480/640)/480
bmp_scale=Sqrt(bmp_mem*8*Fs->pix_height/Fs->pix_width)/Fs->pix_height;
bmp_width =bmp_scale*Fs->pix_width;
bmp_height=bmp_scale*Fs->pix_height;
bmp=CAlloc(bmp_width*bmp_height/8);
} }
U0 CleanUp() U0 CleanUp()
{ {
QueDel(&p_root,TRUE); QueDel(&p_root,TRUE);
DCDel(map); DCDel(map);
Free(bmp);
} }
#define PTS_NUM 1024 #define PTS_NUM 1024
U0 LightTable() U0 LightTable()
{ {
I64 msg_code,i,arg1,arg2,ray_x1,ray_y1,ray_x2,ray_y2; I64 msg_code,i,cnt,arg1,arg2,ray_x1,ray_y1,ray_x2,ray_y2;
CD3I32 *c=MAlloc(PTS_NUM*sizeof(CD3I32)); CD3I32 *c=MAlloc(PTS_NUM*sizeof(CD3I32));
Photon *tmpp;
MenuPush( MenuPush(
"File {" "File {"
@@ -183,10 +221,19 @@ U0 LightTable()
" Fill(,CH_SPACE);" " Fill(,CH_SPACE);"
"}" "}"
"Play {" "Play {"
" RandomBurst(,'b');" " RandomBurst(,'r');"
" ElapseTime(,'e');" " ElapseTime(,'e');"
"}" "}"
); );
MemBIOSRep;
bmp_mem=GetI64("\n\n\nHow much memory for the high resolution\n"
"shadow bitmap that helps improve the\n"
"accuracy of the normal vector estimate?\n"
"You can choose up to the largest\n"
"contiguous chunk of physical memory.\n\n"
"Mem (0x%0X):",1024*1024*16);
PopUpOk( PopUpOk(
"Draw splines with $$GREEN$${Left-click}$$FG$$.\n\n" "Draw splines with $$GREEN$${Left-click}$$FG$$.\n\n"
"Fill lens with $$GREEN$$<SPACE>$$FG$$.\n\n" "Fill lens with $$GREEN$$<SPACE>$$FG$$.\n\n"
@@ -218,24 +265,28 @@ lt_restart:
RayBurst(ray_x1,ray_y1,ray_x2,ray_y2); RayBurst(ray_x1,ray_y1,ray_x2,ray_y2);
break; break;
case MSG_MS_L_DOWN: case MSG_MS_L_DOWN:
i=0; cnt=0;
map->color=ROP_XOR+WHITE; map->color=ROP_XOR+WHITE;
do { do {
c[i].x=arg1; c[i].y=arg2; c[i].z=0; c[cnt].x=arg1; c[cnt].y=arg2; c[cnt].z=0;
Gr2BSpline(map,c,i+1); Gr2BSpline(map,c,cnt+1);
msg_code=GetMsg(&arg1,&arg2, msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_UP+1<<MSG_MS_MOVE+1<<MSG_MS_R_UP); 1<<MSG_KEY_DOWN+1<<MSG_MS_L_UP+1<<MSG_MS_MOVE+1<<MSG_MS_R_UP);
Gr2BSpline(map,c,i+1); Gr2BSpline(map,c,cnt+1);
if (msg_code==MSG_KEY_DOWN) if (msg_code==MSG_KEY_DOWN)
goto lt_restart; goto lt_restart;
else if (msg_code==MSG_MS_L_UP) { else if (msg_code==MSG_MS_L_UP) {
Noise(100,30,50); Sweep(100,70,100);
i++; cnt++;
} }
} while (i<PTS_NUM-1 && msg_code!=MSG_MS_R_UP); } while (cnt<PTS_NUM-1 && msg_code!=MSG_MS_R_UP);
map->pen_width=2; map->color=WHITE;
Gr2BSpline3(map,c,i); Gr2BSpline3(map,c,cnt);
map->pen_width=1; for (i=0;i<cnt;i++) {
c[i].x*=bmp_scale;
c[i].y*=bmp_scale;
}
BSpline2(bmp,c,cnt,&BmpPlot);
break; break;
case MSG_KEY_DOWN: case MSG_KEY_DOWN:
switch (arg1) { switch (arg1) {
@@ -243,7 +294,6 @@ lt_restart:
GrFloodFill(map,ms.pos.x-Fs->pix_left,ms.pos.y-Fs->pix_top); GrFloodFill(map,ms.pos.x-Fs->pix_left,ms.pos.y-Fs->pix_top);
break; break;
case '\n': case '\n':
DCFill;
CleanUp; CleanUp;
Init; Init;
break; break;
@@ -266,7 +316,6 @@ lt_done:
GetMsg(,,1<<MSG_KEY_UP); GetMsg(,,1<<MSG_KEY_UP);
} catch } catch
PutExcept; PutExcept;
DCFill;
Free(c); Free(c);
SettingsPop; SettingsPop;
CleanUp; CleanUp;
+1 -1
View File
@@ -2,7 +2,7 @@ $WW,1$$FG,5$$TX+CX,"Change Log"$$FG$
Use $LK,"R",A="MN:R"$() to rename if I change a label. Use $LK,"R",A="MN:R"$() to rename if I change a label.
$IV,1$----01/30/17 15:11:36----$IV,0$ $IV,1$----01/30/17 17:52:32----$IV,0$
* Added $LK,"::/Demo/Graphics/LightTable.HC"$. * Added $LK,"::/Demo/Graphics/LightTable.HC"$.
$IV,1$----01/27/17 08:13:37----$IV,0$ $IV,1$----01/27/17 08:13:37----$IV,0$
+1 -1
View File
@@ -67,7 +67,6 @@ $LK,"::/Demo/Snd/WaterFowl.HC"$
$MA-X+PU,"::/Apps/Psalmody/Examples",LM="Cd(\"::/Apps/Psalmody/Examples\");Dir;View;\n"$ $MA-X+PU,"::/Apps/Psalmody/Examples",LM="Cd(\"::/Apps/Psalmody/Examples\");Dir;View;\n"$
$LK,"CPURep",A="MN:CPURep"$ $LK,"CPURep",A="MN:CPURep"$
$LK,"::/Demo/MultiCore/MPPrint.HC"$ $LK,"::/Demo/MultiCore/MPPrint.HC"$
$LK,"::/Demo/Graphics/LightTable.HC"$
$LK,"::/Demo/Graphics/PredatorPrey.HC"$ $LK,"::/Demo/Graphics/PredatorPrey.HC"$
$LK,"::/Demo/Graphics/Cartesian.HC"$ $LK,"::/Demo/Graphics/Cartesian.HC"$
$LK,"::/Demo/Graphics/Hanoi.HC"$ $LK,"::/Demo/Graphics/Hanoi.HC"$
@@ -109,6 +108,7 @@ $MA-X+PU,"::/Apps/KeepAway",LM="Cd(\"::/Apps/KeepAway\");Dir;View;\n"$
$LK,"::/Demo/Games/Rocket.HC"$ $LK,"::/Demo/Games/Rocket.HC"$
$LK,"::/Demo/Games/RocketScience.HC"$ $LK,"::/Demo/Games/RocketScience.HC"$
$LK,"::/Demo/Games/MassSpring.HC"$ $LK,"::/Demo/Games/MassSpring.HC"$
$LK,"::/Demo/Graphics/LightTable.HC"$
$LK,"::/Demo/Games/Whap.HC"$ $LK,"::/Demo/Games/Whap.HC"$
$LK,"::/Demo/Games/Squirt.HC"$ $LK,"::/Demo/Games/Squirt.HC"$
$MA-X+PU,"::/Apps/X-Caliber",LM="Cd(\"::/Apps/X-Caliber\");Dir;View;\n"$ $MA-X+PU,"::/Apps/X-Caliber",LM="Cd(\"::/Apps/X-Caliber\");Dir;View;\n"$
+1 -1
View File
@@ -372,6 +372,7 @@ public extern Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0);
public extern U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL); public extern U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL);
public extern I64 FileWrite(U8 *filename, public extern I64 FileWrite(U8 *filename,
U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0); U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0);
#help_index "File/Program Routines;File/FileNames" #help_index "File/Program Routines;File/FileNames"
public extern CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0); public extern CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0);
@@ -760,5 +761,4 @@ public extern F64 tS(); //From SysTimerFreq.
#help_index "Windows" #help_index "Windows"
public extern Bool WinInside(I64 x,I64 y,CTask *task=NULL,I64 border=0); public extern Bool WinInside(I64 x,I64 y,CTask *task=NULL,I64 border=0);
#help_index "" #help_index ""
+3 -3
View File
@@ -657,7 +657,7 @@ U0 DoF2Macro()
U0 DoLightTable() U0 DoLightTable()
{ {
CTask *task=User("#include \"::/Demo/Graphics/LightTable\";\n"); CTask *task=User("#include \"::/Demo/Graphics/LightTable\";\n\n");
BirthWait(&task->popup_task); BirthWait(&task->popup_task);
TaskWait(task->popup_task); TaskWait(task->popup_task);
PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0);
@@ -681,8 +681,8 @@ U0 DoLightTable()
MsSet(320,190); MsSet(320,190);
PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0);
PostMsgWait(task,MSG_MS_R_DOWN,290,240); PostMsgWait(task,MSG_MS_R_DOWN,460,280);
PostMsgWait(task,MSG_MS_R_UP ,320,220); PostMsgWait(task,MSG_MS_R_UP ,500,220);
Sleep(1500); Sleep(1500);
PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0);