Index: bindings.doc ================================================================== --- bindings.doc +++ bindings.doc @@ -57,10 +57,19 @@ Rewind that many moves. '= ' Restart and replay that many moves. +'^<' + Rewind to mark. + +'^>' + Replay to mark. + +'^M' + Set the replay mark position. + '^T' Display the level title popup. '^d' Display the pop-up help text of the object at the location. Index: game.c ================================================================== --- game.c +++ game.c @@ -409,12 +409,13 @@ inputs=realloc(inputs,inputs_size+=32); if(!inputs) fatal("Allocation failed\n"); } inputs[inputs_count++]=number; return 0; - case '+ ': // Replay + case '+ ': replay: // Replay if(number>replay_count-replay_pos) number=replay_count-replay_pos; + if(number<=0) return prev; if(inputs_count+number>=inputs_size) { inputs=realloc(inputs,inputs_size+=number+1); if(!inputs) fatal("Allocation failed\n"); } memcpy(inputs+inputs_count,replay_list+replay_pos,number); @@ -422,22 +423,32 @@ return 0; case '- ': // Rewind number=replay_pos-number; if(number<0) number=0; //fallthru - case '= ': // Restart + case '= ': restart: // Restart begin_level(level_id); if(!number) return 1; if(number>replay_count) number=replay_count; if(number>=inputs_size) { inputs=realloc(inputs,inputs_size=number+1); if(!inputs) fatal("Allocation failed\n"); } memcpy(inputs,replay_list,inputs_count=number); return 1; + case '^<': // Rewind to mark + number=replay_mark; + goto restart; + case '^>': // Replay to mark + inputs_count=0; + number=replay_mark-replay_pos; + goto replay; case '^E': // Edit return -2; + case '^M': // Mark replay position + replay_mark=replay_pos+inputs_count; + return prev; case '^Q': // Quit return -1; case '^T': // Show title modal_draw_popup(level_title); return prev;