From 8088cb942b10eaf1fab0f2e66ec358631af4d92c Mon Sep 17 00:00:00 2001 From: TempleOS-bot Date: Mon, 30 Jan 2017 21:27:26 -0500 Subject: [PATCH] Nightly update (ISO SHA-1 6931795) --- TempleOSCD/0000Boot/0000Kernel.BIN.C | Bin 192080 -> 192080 bytes TempleOSCD/Adam/ADefine.HC | 2 +- TempleOSCD/Compiler/Compiler.BIN | Bin 192920 -> 192920 bytes TempleOSCD/Compiler/CompilerB.HH | 2 +- TempleOSCD/Demo/AcctExample/Registry.HC | 8 +- TempleOSCD/Demo/Graphics/LightTable.HC | 113 +++++++++++++++++------- TempleOSCD/Doc/ChgLog.DD | 2 +- TempleOSCD/Doc/DemoIndex.DD | 2 +- TempleOSCD/Kernel/KernelC.HH | 2 +- TempleOSCD/Misc/OSTestSuite.HC | 6 +- 10 files changed, 93 insertions(+), 44 deletions(-) diff --git a/TempleOSCD/0000Boot/0000Kernel.BIN.C b/TempleOSCD/0000Boot/0000Kernel.BIN.C index a99a69550d4b828370eb544b566fb15beae1aace..8ed11ffab77376639f23599860e39ab3c00dfdbf 100644 GIT binary patch delta 427 zcmca`hx@`E?g=LB8`bnguGn&KUdVEhc{2~op-3hj+07SXRau#Pb!0dHNXn6Ax~RH2 ztzjKAvz9F5WJ62I%?2&fOf0kbWErO`6flZ!PHU5AWRhi^9N(!pc}2T6ORXl9^P}CE zSx7}~vR;QTi?S9(xy0o2ZGxLubR;vvq?iwB%WjVA`Y6sQyE$OdGB%L?KUSmtg0YTCNo9M%O2*mB%*Rw^xAUE4tYv3W{wxD=%Hk`G uo79-pWw(d_X1vDE^jT)RJ~NY5ICG+o?Dm`}CQ(Ob!_P9?TV^wz2?7A$mye_X delta 427 zcmca`hx@`E?g=LBmog`Rzii9Bc_GV1=FL1Tha#EYxNg1>tIEpE@YZ$nkE9$~CRyLj zX$|X`nP0myPByfZ+-%Sy&BVfY-j#8>LII=r=Cn3>MkZIr$?=_vlUKBBvwVCB<@{(j zW>$ORH(9U4mu31Zh;oU^=i3A~ujoi-gh?@*y>ZJV|wMfT}hDf3Lld<Qy<~m2uXkdc%g^lo%yqhd z5MwP^=zI_(uQ-@>Ka=r^Fmv=<*X_q@8MlcrpMyAEeEYOXjPZ=ju8a)R6Q(fgY*(4W z7|X`Uu)S#(<7-}K21bVI1uGb9!Hf?p80(lA8MYU!WSp(cZ28P}JKtHxT6UJg&8`rq yEWX0HNsZ}+>-O;9jMvziHoI=uXJ)brXTJKzb$d<}lc*ze{btwgEwh=<1OWj0ji2WL diff --git a/TempleOSCD/Adam/ADefine.HC b/TempleOSCD/Adam/ADefine.HC index 77fee60..41f9ff2 100644 --- a/TempleOSCD/Adam/ADefine.HC +++ b/TempleOSCD/Adam/ADefine.HC @@ -18,7 +18,7 @@ U0 LoadDocDefines() //$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$ $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"); $ID,-4$ DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR); diff --git a/TempleOSCD/Compiler/Compiler.BIN b/TempleOSCD/Compiler/Compiler.BIN index 7533f7ca9147e40e4025fd6b9c992a91f2005010..e1f8ab4d805fb35df673dfb38c12e6f0b85cd43a 100644 GIT binary patch delta 124 zcmbR7n0v-!?hRK|+4`^D6YamY`Ic&A5|f(jX44Mk80M7%vYVryTrp=X+HN4jSYp6> zSW}jfVRGRd;q7~T7!w$o8+2s1%lk1-l4SZUvwd?qbmHVY`70V~GK)*(+B@ zhRKCtuG=@KGp?&+dgi)4`5EIxZO;5qkM1`f&2J*6 dUStxPUht2RWxJ>l(-bSF7p~h^`!Ky-0stJ7FL(d| diff --git a/TempleOSCD/Compiler/CompilerB.HH b/TempleOSCD/Compiler/CompilerB.HH index 67409e3..76544c0 100644 --- a/TempleOSCD/Compiler/CompilerB.HH +++ b/TempleOSCD/Compiler/CompilerB.HH @@ -21,6 +21,7 @@ extern U0 StreamDir(); public extern I64 StreamExePrint(U8 *fmt,...); public extern U0 StreamPrint(U8 *fmt,...); public extern Bool Trace(Bool val=ON); + #help_index "Compiler/Lex" #help_file "::/Doc/Lex" extern U0 ClassMemberLstDel(CHashClass *c); @@ -64,7 +65,6 @@ public extern I64 PrsKeyWord(CCmpCtrl *cc); #help_index "Compiler;Cmd Line (Typically)" extern I64 Cmp(U8 *filename, U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0); - #help_index "Debugging/Unassemble" 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, diff --git a/TempleOSCD/Demo/AcctExample/Registry.HC b/TempleOSCD/Demo/AcctExample/Registry.HC index dd1940d..4cb8fb4 100644 --- a/TempleOSCD/Demo/AcctExample/Registry.HC +++ b/TempleOSCD/Demo/AcctExample/Registry.HC @@ -50,7 +50,7 @@ $ID,-2$$TR,"Wenceslas"$ $ID,2$F64 best_score=43.9944; $ID,-2$$TR,"OSTestSuite"$ $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$I64 best_score=90; I64 msg_flags=2; @@ -62,13 +62,13 @@ $ID,-2$$TR,"Titanium"$ $ID,2$I64 best_score=16469; $ID,-2$$TR,"TOSRegen"$ $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$$TR,"Adam"$ $ID,2$$ID,-2$$TR,"User"$ $ID,2$$ID,-2$$ID,-2$$TR,"DemoCompany"$ $ID,2$$TR,"Game1"$ -$ID,2$F64 best_score=188.69015; +$ID,2$F64 best_score=236.35149; $TR,"SimpleVal"$ -$ID,2$1236; +$ID,2$1237; $ID,-2$$ID,-2$$ID,-2$ \ No newline at end of file diff --git a/TempleOSCD/Demo/Graphics/LightTable.HC b/TempleOSCD/Demo/Graphics/LightTable.HC index a6e7d1e..41b91de 100644 --- a/TempleOSCD/Demo/Graphics/LightTable.HC +++ b/TempleOSCD/Demo/Graphics/LightTable.HC @@ -7,11 +7,36 @@ class Photon CDC *map; F64 ts; +U8 *bmp; +F64 bmp_scale; +I64 bmp_mem,bmp_width,bmp_height; + +I64 BmpPeek(I64 x,I64 y) +{ + if (0<=xcolor=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; while (tmpp!=&p_root) { dc->color=LTRED; @@ -65,30 +90,34 @@ U0 RandomBurst() } } -#define HEIGHT 10 -U0 FindNormal(CDC *dc,Photon *tmpp,I64 last,I64,CD3 *_normal) +#define HEIGHT (5*bmp_scale) +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),è; + 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) { D3Equ(&s,Cos(é+ã-ã/4-è),Sin(é+ã-ã/4-è)); D3Mul(&v,HEIGHT,&s); - D3Add(&p1,&tmpp->p,&v); - if (GrPeek(dc,p1.x,p1.y)!=last) + D3Add(&p1,&bmp_p,&v); + if (BmpPeek(p1.x,p1.y)!=BLACK) break; } - if (GrPeek(dc,p1.x,p1.y)==last) + if (BmpPeek(p1.x,p1.y)!=WHITE) D3Copy(&p1,&tmpp->p); for (è=0;è<ã/2;è+=ã/HEIGHT) { D3Equ(&s,Cos(é+ã+ã/4+è),Sin(é+ã+ã/4+è)); D3Mul(&v,HEIGHT,&s); - D3Add(&p2,&tmpp->p,&v); - if (GrPeek(dc,p2.x,p2.y)!=last) + D3Add(&p2,&bmp_p,&v); + if (BmpPeek(p2.x,p2.y)!=BLACK) break; } - if (GrPeek(dc,p2.x,p2.y)==last) + if (BmpPeek(p2.x,p2.y)!=WHITE) D3Copy(&p2,&tmpp->p); D3Sub(&s,&p1,&p2); @@ -99,7 +128,7 @@ U0 FindNormal(CDC *dc,Photon *tmpp,I64 last,I64,CD3 *_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 Sin(é1) == n2 Sin(é2) @@ -113,7 +142,7 @@ U0 SnellsLaw(CDC *dc,Photon *tmpp,I64 last,I64 next) n2=1.5; else n2=1.0; - FindNormal(dc,tmpp,last,next,&normal); + FindNormal(tmpp,last,next,&normal); én=Arg(normal.x,normal.y); //dot=m1m2Cos(é); é1=ACos(D3Dot(&normal,&tmpp->v)); @@ -138,15 +167,14 @@ U0 AnimateTask(I64) while (tmpp!=&p_root) { last=GrPeek(map,tmpp->p.x,tmpp->p.y); 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.y<=0) tmpp->v.y=-tmpp->v.y; - if (tmpp->p.y>=map->height) 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; next=GrPeek(map,tmpp->p.x,tmpp->p.y); if (last!=next && - (last==BLACK && next==WHITE) || - (last==WHITE && next==BLACK)) - SnellsLaw(map,tmpp,last,next); + (last==BLACK && next==WHITE) || (last==WHITE && next==BLACK)) + SnellsLaw(tmpp,last,next); tmpp=tmpp->next; } Sleep(1000*ts); @@ -158,20 +186,30 @@ U0 Init() ts=0.01; map=DCNew(Fs->pix_width,Fs->pix_height); 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() { QueDel(&p_root,TRUE); DCDel(map); + Free(bmp); } #define PTS_NUM 1024 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)); - Photon *tmpp; MenuPush( "File {" @@ -183,10 +221,19 @@ U0 LightTable() " Fill(,CH_SPACE);" "}" "Play {" - " RandomBurst(,'b');" + " RandomBurst(,'r');" " 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( "Draw splines with $$GREEN$${Left-click}$$FG$$.\n\n" "Fill lens with $$GREEN$$$$FG$$.\n\n" @@ -218,24 +265,28 @@ lt_restart: RayBurst(ray_x1,ray_y1,ray_x2,ray_y2); break; case MSG_MS_L_DOWN: - i=0; + cnt=0; map->color=ROP_XOR+WHITE; do { - c[i].x=arg1; c[i].y=arg2; c[i].z=0; - Gr2BSpline(map,c,i+1); + c[cnt].x=arg1; c[cnt].y=arg2; c[cnt].z=0; + Gr2BSpline(map,c,cnt+1); msg_code=GetMsg(&arg1,&arg2, 1<pen_width=2; - Gr2BSpline3(map,c,i); - map->pen_width=1; + } while (cntcolor=WHITE; + Gr2BSpline3(map,c,cnt); + for (i=0;ipix_left,ms.pos.y-Fs->pix_top); break; case '\n': - DCFill; CleanUp; Init; break; @@ -266,7 +316,6 @@ lt_done: GetMsg(,,1<popup_task); TaskWait(task->popup_task); PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); @@ -681,8 +681,8 @@ U0 DoLightTable() MsSet(320,190); PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_MS_R_DOWN,290,240); - PostMsgWait(task,MSG_MS_R_UP ,320,220); + PostMsgWait(task,MSG_MS_R_DOWN,460,280); + PostMsgWait(task,MSG_MS_R_UP ,500,220); Sleep(1500); PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0);