Index: TODO ================================================================== --- TODO +++ TODO @@ -6,10 +6,12 @@ * String data (partially implemented) * A ,PopUp command to use a popup with arguments starting from a mark * Possibility to define auto-generation levels mode * Popup inventory list (with optional possibility of choice) (?) * Playfield array + * Replacement patterns + * MID_TURN message / custom trigger phase * Editor * Mouse dragging * Deal better with allowing to skip past corrupted levels * Picture editor/loading * Allowing more altimages @@ -32,21 +34,25 @@ * SQL * Implement the GROUP column in the CLASSES table * Allow multiple SQL statements in one binding * Fonts/text * More code pages - * Large fonts (possibly: width 8 or 16, height 8-32) - * Multibyte encodings (e.g. EUC-JP) + * Large fonts + * Multibyte encodings (TRON code) * Branching replay recording * Slow movement displaying state between triggers * Warning if file changed when uncommited data exists in the cache database * Cache database option to be keyed by hash * Composite puzzle set format (implemented) * Optional hypertext help * Compressed class definitions (?) -* Option to auto display level titles -* Option to use a separate solution file +* User interface options + * Auto display level titles + * Separate solution file + * Start on level select screen + * Start on most recently accessed level + * Start on first unsolved level * Multiuser scoring within one computer system (optional capability) * Launcher menu (optional; separate program) * Implement the (obsolete?) ImageSeq and ImageLoop commands (used in DESERT3) * Testing * Bizarro world Index: class.c ================================================================== --- class.c +++ class.c @@ -1633,11 +1633,11 @@ s->addr=ptr-1; s->next=labelstack; labelstack=s; } break; - case OP_IF: case OP_OR: case OP_AND: case OP_FORK: + case OP_IF: case OP_IF_C: case OP_OR: case OP_AND: case OP_FORK: AddInst(tokenv); FlowPush(OP_IF); peep=++ptr; break; case OP_THEN: @@ -1661,14 +1661,23 @@ break; case OP_UNTIL: FlowPop(OP_BEGIN); AddInst2(OP_IF,flowptr[flowdepth]); break; + case OP_UNTIL_C: + FlowPop(OP_BEGIN); + AddInst2(OP_IF_C,flowptr[flowdepth]); + break; case OP_WHILE: AddInst(OP_IF); FlowPush(OP_WHILE); peep=++ptr; + break; + case OP_WHILE_C: + AddInst(OP_IF_C); + FlowPush(OP_WHILE); + peep=++ptr; break; case OP_REPEAT: FlowPop(OP_WHILE); x=flowptr[flowdepth]; FlowPop(OP_BEGIN); Index: class.doc ================================================================== --- class.doc +++ class.doc @@ -2234,10 +2234,14 @@ the same behaviour. or then ( any -- any ) Takes a value from the stack. If it is true, leaves it there and skips the body, otherwise removes it and executes the body. + +Any of the keywords "if", "while", and "until" in the above constructions +can optionally have a comma prefix; if they do, then the value remains on +the top of the stack if it is true, and is only popped if it is zero. === Case blocks === A case block consists of (case) with the cases listed inside of the () after Index: exec.c ================================================================== --- exec.c +++ exec.c @@ -3345,10 +3345,11 @@ case OP_HEIGHT_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->height=t1.u; break; case OP_HEIGHT_EC16: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->height=t1.u&0xFFFF; break; case OP_HEIGHTAT: StackReq(2,1); t2=Pop(); Numeric(t2); t1=Pop(); Numeric(t1); Push(NVALUE(height_at(t1.u,t2.u))); break; case OP_HITME: NoIgnore(); StackReq(1,1); t1=Pop(); Numeric(t1); i=v_hitme(obj,t1.u); break; case OP_IF: StackReq(1,0); if(v_bool(Pop())) ptr++; else ptr=code[ptr]; break; + case OP_IF_C: StackReq(1,1); t1=Pop(); if(v_bool(t1)) { ptr++; Push(t1); } else ptr=code[ptr]; break; case OP_IGNOREKEY: if(current_key) key_ignored=all_flushed=1; break; case OP_IMAGE: StackReq(0,1); Push(NVALUE(o->image)); break; case OP_IMAGE_C: StackReq(1,1); Push(GetVariableOf(image,NVALUE)); break; case OP_IMAGE_E: NoIgnore(); StackReq(1,0); t1=Pop(); Numeric(t1); o->image=t1.u; break; case OP_IMAGE_EC: NoIgnore(); StackReq(2,0); t1=Pop(); Numeric(t1); i=v_object(Pop()); if(i!=VOIDLINK) objects[i]->image=t1.u; break; Index: instruc ================================================================== --- instruc +++ instruc @@ -76,17 +76,17 @@ rotback "-rot" pick over ; Flow controls --if +-,if -else -then -begin -again --until --while +-,until +-,while -repeat -for -next *goto *CallSub Index: instruc.h ================================================================== --- instruc.h +++ instruc.h @@ -14,16 +14,19 @@ #define OP_ROT 32773 #define OP_ROTBACK 32774 #define OP_PICK 32775 #define OP_OVER 32776 #define OP_IF 32777 +#define OP_IF_C 34825 #define OP_ELSE 32778 #define OP_THEN 32779 #define OP_BEGIN 32780 #define OP_AGAIN 32781 #define OP_UNTIL 32782 +#define OP_UNTIL_C 34830 #define OP_WHILE 32783 +#define OP_WHILE_C 34831 #define OP_REPEAT 32784 #define OP_FOR 32785 #define OP_NEXT 32786 #define OP_GOTO 32787 #define OP_CALLSUB 32788 @@ -848,11 +851,11 @@ {"flip",8421615}, {"for",8683537}, {"fork",8683547}, {"ge",8486968}, {"gt",8486966}, -{"if",8683529}, +{"if",8749065}, {"in",8421612}, {"is",8421434}, {"land",8421423}, {"le",8486969}, {"link",8683549}, @@ -888,10 +891,10 @@ {"swap",8421378}, {"then",8683531}, {"tmark",8421611}, {"tuck",8421380}, {"uniq",8421618}, -{"until",8683534}, -{"while",8683535}, +{"until",8749070}, +{"while",8749071}, }; #define N_OP_NAMES 374 #endif