TASEmulators / pcem

PCem (short for PC Emulator) is an IBM PC emulator. This version of PCem has multi-threading disabled in order to ensure determinism when running though libTAS.
http://tasvideos.org/EmulatorResources/PCem.html
GNU General Public License v2.0
5 stars 1 forks source link

Hotkeys to change CD/floppy #3

Closed vadosnaprimer closed 3 years ago

vadosnaprimer commented 3 years ago

I think this workflow would be ideal:

CD_path_var = file1.ext;file2.ext;file3.ext

In the cfg file for a given machine (the variable being whatever PCem uses for a changeable image path, delimiter being whatever char fits best). This would queue 3 file paths in a given order.

Since the order to actually load the images in may be unknown in advance (routing out image order could be done while doing a test tas), we seem to need 2 keys to select "next" and "previous", and one command to load the currently selected image,

Also since PCem has 1 CD drive and 2 floppy drives, we seem to need 3 sets of those commands, 3 for each drive.

Finally, we need PCem to print to console which image was selected and which image was loaded. When it first loads the queue, probably print it all out so it's obvious what we're working with.

clementgallet commented 3 years ago

Could you suggest which keys to use?

vadosnaprimer commented 3 years ago

Existing hotkeys in the code so far (wx-sdl2-display.c and wx-sdl2-display-win.c):

Ctrl + End/NumPad1 - Release mouse
Ctrl + Alt + PageDown/NumPad3 - Toggle fullscreen
Ctrl + Alt + PageUp/NumPad9 - Take screenshot

For our stuff I suggest:

Ctrl + / + LeftArrow - Select previous CD in the queue
Ctrl + / + RightArrow - Select next CD in the queue
Ctrl + / + DownArrow - Load selected CD
Ctrl + . + LeftArrow - Select previous disk A in the queue
Ctrl + . + RightArrow - Select next disk A in the queue
Ctrl + . + DownArrow - Load selected disk A
Ctrl + , + LeftArrow - Select previous disk B in the queue
Ctrl + , + RightArrow - Select next disk B in the queue
Ctrl + , + DownArrow - Load selected disk B

PCem supports zip drives and cassettes, but for games those don't seem to be needed

clementgallet commented 3 years ago

Some comments regarding 9b02d13 so that I'm not forgetting anything:

vadosnaprimer commented 3 years ago

It would be highly desirable to have the image swap indication in release builds, for end users (first and foremost tasers, but also judges).

Also what's tail -f?

clementgallet commented 3 years ago

tail is to view the end of a text file, and -f updates the view continuously. I'll add the image swap log in the terminal then.

clementgallet commented 3 years ago

Added floppy switch in 1f6d8c5. Add messages to stdout for CD/floppy switch and load. I modified a bit the hotkeys so that the one that is buggy for me controls floppy drive b::

slamotas commented 3 years ago

It should be obvious but we should mention that the floppy paths should be specified in disc_a = and disc_b = in the config file.

I tested both floppy and CD swapping and it all works without a problem. I even tried recording a movie in libTAS with the hotkeys and it played back with the proper switching. Looks like we should be able to TAS multi-disk games with this, thank you!

I should mention that if you put an invalid path as one of the disks and try to load it, the drive becomes empty. This could be useful in obscure cases.

vadosnaprimer commented 3 years ago

Thank you guys!