CATRUN V1.1
Implemented by norecess464 2023.
-=-=-=-=-

CATRUN is a simple tool for the Amstrad CPC machines to fasten the process of disc's content discovery / launch a program.

When inserting a new disc into the machine, I bet than 95% of the regular Amstrad CPC users will first type the CAT command to discover its content, then type RUN"FILENAME to launch a targeted program.

With CATRUN, the user can press CTRL+TAB at machine startup (or any other time, of course) to show the list of files stored on the disc, then use the arrow keys to select the targeted file to execute, then press RETURN to auto-type the RUN command. Few key presses are saved in the process, while enhancing (a little bit !) the launching experience.

While selecting a file, it's also possible to:

* type ESC key to just get back to BASIC (cf. discard the RUN command)
* type TAB key to redo a catalogue discovery (cf. when the user is willing to change disc and rebrowse its content)
* type R key to rename the selected file
* type D or E key to delete the selected file

And that's all :)

There are few things to know:

* supports both MODE 1 and MODE 2. If the current video mode is MODE 0, then a regular CAT will be applied and the user will get back to BASIC
* to be available system-wide from the BASIC prompt, this program is distributed as a ROM to be installed on a ROMBoard (X-MEM etc.)
* the program only takes few bytes for the ROM initialization (cf. required for the system handling of |CATRUN shortcut through Control+Tab keys). The execution itself of the program does not require any extra RAM!
* if the catalogue on disc appears to be a CATART, then a regular CAT will be applied and the user will get back to BASIC
* if the catalogue appears to be impossible to browse for whatever reasons, then a regular CAT will be applied and the user will get back to BASIC. This happens for example with the (great!) Duke's M4 expansion not behaving internally like the regular CAT from Amstrad -- for programmers: the 2K buffer not being populated by CAS CATALOG.
* generally speaking, this program refers only to firmware routines. It has full compatibility between 464, 664 and 6128 Amstrad CPC machines (tested)
* a test is done to ensure that the call of |CATRUN is made from the BASIC prompt. There would be no purpose to trigger CATRUN from Protext command prompt (yes, it's possible!), for example.
* internally relies on a "fast print routine" (faster than the standard Amstrad one), as discussed here.
* automatically switch the disc drive to fast drive parameters (BIOS SETUP DISC). This might accelerate things a little bit...
* when displaying a catalog, CATRUN will try to pre-select an executable file, based on filename (thanks Eto/Prodatron!):
 * if it finds a file "disc."/"disk."/"disc.bas"/"disk.bas"/"disc.bin"/"disk.bin"
 * and if not, if it finds the first "*. "
 * and if not, if it finds the first "*.bas"
 * and if not, if it finds the first "*.bin"
 Very useful, most of the time it's accurate. 

Some extra-testing has been achieved by Poulette73 (thanks!) on multiple hardware configurations (cf. when Amsdos gets patched with custom file systems):

* M4 Board + USB storage is well supported
* RSF3 + USB storage is well supported
* CubeMDOS, UniDOS, ParaDOS and X-Ddos work fine too

--
Final words.
This program is useful to me. With some luck it will also be useful to you ! :)

>>norecess464.condense 2023!

Thanks to TotO, Poulette73, roudoudou & everyone else keeping the Amstrad scene alive! =)


--
CHANGELOG
V1.1 (17th of Sept 2023) -> First feedbacks received, adjusting few things.
- implemented pre-selection of an executable file in the catalog, based on filename (thanks Eto/Prodatron!):
 * if it finds a file "disc."/"disk."/"disc.bas"/"disk.bas"/"disc.bin"/"disk.bin"
 * and if not, if it finds the first "*. "
 * and if not, if it finds the first "*.bas"
 * and if not, if it finds the first "*.bin"
 Very useful, most of the time it's accurate. 
 Of course, user must still press RETURN key to trigger the launch of the program (cf. RUN it).
- if we are about to display more than 42 files in MODE 1, the video-mode will be automatically switched to MODE 2 (to allow more files displayed on screen)
- 2 new (unrelated) helpers, while I was at it:
 * it's now possible to press E or D keys ("E"rase or "D"elete) to delete the selected file. A confirmation gets presented to the user before proceeding.
 * it's now possible to press R key ("R"ename) to rename the selected file. ESC to cancel while entering the new filename.

V1.0 (15th Sept 2023) -> Initial release 