MonitorUI: Difference between revisions

From vice-emu
Jump to navigation Jump to search
m (Created page with 'Reason for this page: defining the intended behaviour of the monitor (g)ui to maintain consistency across ports and to prevent needless work :) =general= ==entering the monitor=…')
 
No edit summary
Line 1: Line 1:
Reason for this page: defining the intended behaviour of the monitor (g)ui to maintain consistency across ports and to prevent needless work :)
Reason for this page: defining the intended behaviour of the monitor (g)ui to maintain consistency across ports and to prevent needless work :)


=general=
=General Behaviour=
==entering the monitor==
==Entering the monitor==
* exit fullscreen mode if needed
* exit fullscreen mode if needed
* if monitor window is not visible, enable it
* if monitor window is not visible, enable it
* transfer focus to the monitor window
* transfer focus to the monitor window
==leaving the monitor==
==Leaving the monitor==
* restore fullscreen mode, make emulation window visible
* restore fullscreen mode, make emulation window visible
* transfer focus to the emulator window
* transfer focus to the emulator window


=keeping the monitor open=
Single stepping should not close the monitor. There's no need to set the focus back to the emulator window for a single assembly instruction.
If <tt>console_log->console_can_stay_open</tt> (which is a constant) is 1, the respective console driver is capable of outputting text even when the monitor is not active (ie the emulation is running). This can be useful because eg trace/watch output shows up immediatly.


'''TODO''': Since "keep open on exit" is not what everyone wants, a new resource <tt>KeepMonitorOpen</tt> should allow to toggle this behavior
=Reasons for keeping the monitor open or for closing it=
==Keeping the monitor open==


==close on exit==
The console driver is capable of outputting text even when the monitor is not active (ie when the emulation is running). This can be useful because eg trace/watch output shows up immediately.
This is the default behavior, which is also (exclusively) used by most ports.
 
* exiting the monitor closes the monitor window, closing the monitor window exits the monitor respectively
Additionally developers may want to look at the last monitor output (e.g. a piece of disassembly) while the emulation runs.
 
==Close on exit==
 
Exiting the monitor closes the monitor window, closing the monitor window exits the monitor respectively. The emulation continues and no monitor window clobbers the screen anymore. This is the default behavior, which is also (exclusively) used by most ports.
 
=Proposed Solution=
 
The existing command ''exit'' shall close the monitor window and continue the emulation. A close button of the monitor window (if any) shall act in the same way as the command ''exit''.
 
To be able to keep the monitor window open even when the emulation is re-started, a new command ''cont'' (continue) is to be added.
 
These two commands allow the user to to do what he wants in any situation.
 
''To be clarified: Should exit close the link to a remote monitor?''
 
=Implementation=


==keep open on exit==
==keep open on exit==

Revision as of 12:11, 12 March 2012

Reason for this page: defining the intended behaviour of the monitor (g)ui to maintain consistency across ports and to prevent needless work :)

General Behaviour

Entering the monitor

  • exit fullscreen mode if needed
  • if monitor window is not visible, enable it
  • transfer focus to the monitor window

Leaving the monitor

  • restore fullscreen mode, make emulation window visible
  • transfer focus to the emulator window

Single stepping should not close the monitor. There's no need to set the focus back to the emulator window for a single assembly instruction.

Reasons for keeping the monitor open or for closing it

Keeping the monitor open

The console driver is capable of outputting text even when the monitor is not active (ie when the emulation is running). This can be useful because eg trace/watch output shows up immediately.

Additionally developers may want to look at the last monitor output (e.g. a piece of disassembly) while the emulation runs.

Close on exit

Exiting the monitor closes the monitor window, closing the monitor window exits the monitor respectively. The emulation continues and no monitor window clobbers the screen anymore. This is the default behavior, which is also (exclusively) used by most ports.

Proposed Solution

The existing command exit shall close the monitor window and continue the emulation. A close button of the monitor window (if any) shall act in the same way as the command exit.

To be able to keep the monitor window open even when the emulation is re-started, a new command cont (continue) is to be added.

These two commands allow the user to to do what he wants in any situation.

To be clarified: Should exit close the link to a remote monitor?

Implementation

keep open on exit

This is optional behavior which is only available on ports that support it (currently: win32, gtk, xaw). It should be enabled if both console_log->console_can_stay_open and KeepMonitorOpen are 1

  • the monitor window stays open all the time, except for when the user closes the window.
    • TODO: this creates the problem that the monitor window might be closed, although console_log->console_can_stay_open and KeepMonitorOpen are 1. This must be handled somehow by switching between buffered and non buffered mode at runtime.
  • entering and exiting the monitor only transfers focus to/from the emulation window respectively