- Category: Usage
You can change the input mapping of all keys during runtime using the OSD menu. Open the menu and find the entry "Input settings", then "Input Assignments (this system)" (0.249).
You will get a list of key mappings similar to this:
On the left side you can see the key in the emulation. Often, there are more than one character, which means that the key accepts a modifier, that is, Shift or FCTN. The x key, for instance, may produce a lowercase x normally, a capital X when pressed with Shift, and Cursor Down when pressed with FCTN. This key is mapped on the right side to the X key of the host keyboard.
Let's change the Alpha Lock mapping. We see that it is mapped to CAPSLOCK, which is not a good idea. We want it to be mapped to the left Windows key, which we don't need otherwise.
You can see that several keys on the host may be mapped to the same emulated key: For example, to make the emulated TI sense a pressed FCTN key, either the left or right FCTN key on the host keyboard will do - the TI does not distinguish them. On 105-key keybords, the right ALT key is usually named "AltGr".
First we remove the old mapping. Highlight the AlphaLock line as shown above (by moving the yellow marker with cursor keys or using the mouse and single-clicking on the entry). Hit DEL to remove the old mapping:
Next, we add a new mapping. Hit the RETURN key; the OSD will show two triangles, indicating that it waits for an input from you.
We now press the Left Windows key. Accordingly, this is shown on the menu:
We may now leave the OSD menu again.
By the way, if you wondered why there is a second Alpha Lock entry ("non-toggle"): This is handy when you connect a TI keyboard via a USB adapter. The Alpha Lock key is then held by its mechanics, and there must not be a toggle inside the emulator.
- Category: Usage
The Mechatronics mouse must be plugged into the joystick port of the TI console:
mame ti99_4a -joyport mecmouse [-mouse]
As said above, use the -mouse switch in the command line to capture the mouse.
Examples for Mechatronics mouse software
These two examples can be found on the companion disk of the Mechatronics mouse.
A simple calculator with a mouse pointer in the shape of a hand. The pointer is a sprite that is smoothly moved by the mouse. Use the left mouse button to type in a number or operation.
This is the well-known Breakout game with mouse support. Works quite well, press the mouse button after positioning the paddle below a number to enter the game at the desired level.
The third tool is a kind of graphical file manager. There are some bugs in the software, however: The program seems to be confused with 360K disks, and the mouse axes are swapped after clicking on a file.
- Category: Usage
In earlier MAME releases, the mouse was assumed to be connected, and the host mouse was mapped to that mouse. In Windows this meant that once you ran the Geneve emulation, your Windows mouse pointer was gone until you stopped MAME again. This is particular nasty when you just did not plan to use the mouse.
In order to avoid this, the mouse must be explicitly attached to the colorbus of the Geneve since release 0.213. If you don't use this, there is no mouse in the Geneve emulation, but you keep the mouse for the Windows desktop.
In Linux the mouse capture is not done automatically, so as said above, use the -mouse switch in the command line.
mame geneve -colorbus busmouse [-mouse]
When the -mouse switch is used, you will lose the pointer on your PC desktop, which also means you cannot use the mouse to close the emulation window. To leave the emulation, use the Esc key in partial keyboard mode (press ScrlLock, then Esc).
Examples for mouse usage
These two screenshots of the Fractals program demonstrate how the mouse is used in Geneve programs.
The small yellow box is a text cursor that moves over the screen when the mouse is moved. In this screen, a dialog for selecting a file is presented. The left mouse button allows the user to select a file or a file format. Note that the mouse can only sit on one of 80x25 screen positions; this means that the host mouse movement must be scaled down. This is done inside the Fractals program; for instance, 8 pulses in one direction means to move the text cursor by one row or column.
The arrow-shaped pointer can be moved with the mouse in order to define the drawing area. In this case, the mouse movement is directly used to move the pointer on the screen, where we have a resolution of 512x212 pixels. By clicking and holding the left button, the rectangle bounds can be defined when moving the mouse. Once the mouse button is released, the dimensions are passed to the drawing routine.
- Category: Usage
The general problem that we face is how to translate the real mouse movement into the emulated mouse movement. You might think at first that this is pretty easy; if the PC mouse is moved by a certain distance, just do the same in the emulation.
However, this does not work for multiple reasons.
- The emulation uses a special screen resolution that may be scaled by changing the emulation window size. Imagine that your host PC screen resolution is full HD (1920x1080); the emulated screen is 256x192 on the TI, or 512x212 on the Geneve. You most likely pulled the window borders to give you a larger display, but it still has the same emulated resolution. Now how is this supposed to be mapped into the emulation?
- The MAME framework has no idea of the resolution of the emulated screen and the screen mode. For instance, on the TI we could use text mode or graphics mode. When we move the mouse in text mode, this is a grid of 40x24 or 80x25 locations. In graphics mode, we can have the full 512x212 on the Geneve.
- The emulated system may have its own way of scaling the mouse movement. Imagine you write a program on the Geneve that uses the mouse, and you want to set the mouse speed. This is no problem; you simply get the mouse movement and calculate the effective movement from it by some factor. How could MAME possibly know that the mouse movement is scaled inside the emulated system? This is not only difficult, it is conceptually impossible.
So when you use the emulation in a window, it is just not possible to map the host mouse movement directly into the emulation so that the emulated mouse and the PC mouse run in sync. In other words, the mouse in the emulation will have its own speed, and if you have a mouse pointer in the emulation, it will not stay together with the host mouse pointer.
The figure on the left illustrates the problem. Suppose that you move a mouse pointer on your host desktop from left to right, crossing the emulation window. You may expect that the mouse movement is seamlessly translated into the emulation. However, we see that the emulation window does not use the same screen resolution as the host desktop, so a movement by 10 positions would seem like a much longer movement inside the emulation.
To make things a bit worse, we have to consider when the emulation is supposed to sample the host mouse movement. At every time, even when you are not using the emulation? Only when you focus the emulation window? - In MAME, the mouse movement is sampled when the host mouse pointer hovers over the emulation window. That means that you have to first move the host mouse pointer over the emulation window before its input is fed into the emulation. When you move the mouse, it is certainly not guaranteed that you reach all locations in the emulated screen before the mouse pointer leaves the emulation window.
The solution to these issues is simple and is also applied in many other emulations like VirtualBox or VMWare: The mouse must be captured. By this we mean that the host mouse pointer disappears, and only the emulated mouse seems to respond to the movements. This prevents the problem of activating or deactivating the mouse movement sampling, because it is always active as long as the mouse remains captured. When the emulation is stopped, the mouse is freed and returned to the host desktop system.
In MAME it is currently not supported to capture or to free the mouse during runtime. You can only specify that the mouse be captured when starting the emulation.