From 17b5ba0f494119bb515d96bef58077f783b73c33 Mon Sep 17 00:00:00 2001 From: otya128 Date: Fri, 30 Dec 2016 21:12:46 +0900 Subject: [PATCH] Fix input --- SMILEBASIC/VM.d | 4 ++-- SMILEBASIC/petitcomputer.d | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SMILEBASIC/VM.d b/SMILEBASIC/VM.d index f031ffb..bfbe511 100644 --- a/SMILEBASIC/VM.d +++ b/SMILEBASIC/VM.d @@ -1873,7 +1873,7 @@ class InputCode : Code { vm.petitcomputer.console.printString("?Redo from start \n"); } - wstring input = vm.petitcomputer.input("", false); + wstring input = vm.petitcomputer.input("", false, true); wstring[] split = input.split(","); error = false; if(split.length == 0) @@ -2558,6 +2558,6 @@ class Linput : Code { Value guide; vm.pop(guide); - vm.push(Value(vm.petitcomputer.input(guide.castDString, false))); + vm.push(Value(vm.petitcomputer.input(guide.castDString, false, true))); } } diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index 182c6ca..b66496e 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -1113,7 +1113,7 @@ class PetitComputer { printPrompt(); } - auto prg = input("", true); + auto prg = input("", true, false); if (!prg.empty && (inputHistory.length == 0 || inputHistory[inputHistory.length - 1] != prg)) { inputHistory.put(prg); @@ -1322,7 +1322,7 @@ class PetitComputer keybufferlen = 0; } RingBuffer!wstring inputHistory = new RingBuffer!wstring(32/*ダイレクトモードでの履歴の数は32*/); - wstring input(wstring prompt, bool useClipBoard) + wstring input(wstring prompt, bool useClipBoard, bool isVM/*if this flag is true, enable start/select interrupt*/) { auto olddisplay = displaynum; //displaynum = 0; @@ -1383,10 +1383,10 @@ class PetitComputer console.CSRX = 0; } } - while(!quit) + while(!quit && (!isVM || running)) { auto oldpos = keybufferpos; - while(oldpos == keybufferpos && !quit) + while(oldpos == keybufferpos && !quit && (!isVM || running)) { Button old; synchronized(buttonLock)