--- hatari/tools/hconsole/hconsole.py 2019/04/09 08:50:46 1.1.1.2 +++ hatari/tools/hconsole/hconsole.py 2019/04/09 08:51:30 1.1.1.3 @@ -5,7 +5,7 @@ # devices and changing Hatari command line options (even for things you # cannot change from the UI) from the console while Hatari is running. # -# Copyright (C) 2008-2011 by Eero Tamminen +# Copyright (C) 2008-2012 by Eero Tamminen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -97,6 +97,9 @@ class Hatari: except OSError as value: print("Hatari PID %d had exited in the meanwhile:\n\t%s" % (self.pid, value)) self.pid = 0 + if self.control: + self.control.close() + self.control = None return False return True @@ -181,11 +184,13 @@ class Hatari: print("debug output", self.verbose) def kill_hatari(self): - if self.pid: + if self.is_running(): os.kill(self.pid, signal.SIGKILL) print("killed hatari with PID %d" % self.pid) - self.control = None self.pid = 0 + if self.control: + self.control.close() + self.control = None # command line parsing with readline @@ -218,36 +223,40 @@ class CommandInput: class Tokens: - # update with: hatari -h|grep -- --|sed 's/^ *\(--[^ ]*\).*$/ "\1",/' + # update with: hatari -h|grep -- --|sed 's/^ *\(--[^ ]*\).*$/ "\1",/'|grep -v -e control-socket -e 'joy<' option_tokens = [ "--help", "--version", "--confirm-quit", "--configfile", + "--keymap", "--fast-forward", "--mono", "--monitor", "--fullscreen", "--window", "--grab", - "--zoom", - "--max-width", - "--max-height", - "--aspect", - "--borders", "--frameskips", "--statusbar", "--drive-led", - "--spec512", "--bpp", + "--borders", + "--desktop-st", + "--spec512", + "--zoom", + "--desktop", + "--max-width", + "--max-height", + "--force-max", + "--aspect", "--vdi", "--vdi-planes", "--vdi-width", "--vdi-height", + "--crop", "--avirecord", "--avi-vcodec", "--avi-fps", - "--avi-crop", "--avi-file", "--joy0", "--joy1", @@ -271,24 +280,30 @@ class Tokens: "--ide-master", "--ide-slave", "--memsize", + "--memstate", "--tos", + "--patch-tos", "--cartridge", - "--memstate", "--cpulevel", "--cpuclock", "--compatible", "--machine", "--blitter", - "--timer-d", "--dsp", + "--timer-d", + "--fast-boot", + "--rtc", + "--mic", "--sound", - "--keymap", + "--sound-buffer-size", + "--ym-mixing", "--debug", "--bios-intercept", "--trace", "--trace-file", "--parse", "--saveconfig", + "--no-parachute", "--log-file", "--log-level", "--alert-level", @@ -343,8 +358,8 @@ class Tokens: "dspreg", "dspsymbols", "evaluate", - "exec", "help", + "history", "info", "loadbin", "lock", @@ -352,6 +367,8 @@ class Tokens: "memdump", "memwrite", "parse", + "profile", + "quit", "savebin", "setopt", "stateload",