Git Product home page Git Product logo

rloader's Introduction

RLoader

DOS programs launcher with customizable lists, search and thumbnails display.

Developed entirely in Borland C++ 3.0 as a simple list viewer to launch DOS programs, it has been extended by integrating:

  • text search,
  • definition of multiple program lists,
  • display of thumbnails of the program title and in-program graphics,
  • simplified display of markdown files as help and information on the elements of the active list
  • a fully functional text-mode interface for low-end machines

The interface designed for the arrow keys and only 5 other function keys makes it perfect to use in DOSBox even when user input is handled via a gamepad (and proper key mapping).

SCREEN01 SCREEN02 SCREEN03 SCREEN04 SCREEN05

Installation

Simply copy the two executable files and the res and lists folders to a folder of your choice.

Configuration

RLoader is configurable through the RES/RLOADER.CFG file.

The foreground and background colors of the user interface and the mapping of the drives specified in the lists can be customized (see the comments in the configuration file for more info).

This last feature allows the porting of the lists from one system to another without the need to modify the absolute paths.

Hardware requirements (for a real machine)

RLoader was compiled using the 8086 instruction set and implements two user interfaces: one graphical and one in text mode.

The former requires a compatible VGA graphics card while the latter makes it usable even on low-end machines with a compatible CGA graphics card.

Thanks to jsmolina for pointing out a compatibility issue in some emulators when text mode is used on CGA graphics cards and to mills32 for testing on pcem and dosbox-x.

Now RLoader works correctly even on CGA mono and composite, tandy, pcjr, amstrad, mcga, mda machines.

Execution

You can run RLoader without arguments or with /h or /? to view a short help.

To load the example list on real hardware or VM, type:

RLOADER example

if you are on DOSBox, type:

RLOADER /dosbox example

If you want to use the text-mode interface, type:

RLOADER /textmode example

Running from any location

RLOADER.EXE is designed to search for UI.EXE in the current working directory, creating some problems in some particular execution scenarios, like:

E:\UTILS\RLOADER.EXE example

Since version 1.0.3 it is possible to define the environment variable RLOADER_PATH to specify the path of rloader, so that it can be executed from any location.

The variable can contain the drive designator, it is treated in a case-insensitive way and must not end with the directory separator character (\ or /). Example of valid paths:

set RLOADER_PATH=D:\UTILITIES\RLOADER
set RLOADER_PATH=c:\rloader

Loading RLoader in upper memory

As pointed out by cyberluke the resident part of RLoader occupies an entire segment (64Kb) even if the executable is smaller in size.

Now that it has been rewritten in assembly, a TSR-like behavior has been implemented whereby all unused memory paragraphs are released immediately after loading. This, together with the reduction of a tenth of the file size, makes it easier to load into upper memory, leaving the rest of the conventional memory available to the launched programs.

LH RLOADER example

Troubleshooting

RLoader also has arguments to simplify troubleshooting if the launch of the listed programs fails:

  • /batchpause pauses the dynamically generated batch file that launches the program just before returning to RLoader, in order to make any error messages readable;

  • /batchmemfree displays the memory available to the program that is launched using the mem /free command, available both in compatible MS-DOS environments and in the various flavors of DOSBox.

List and info navigation

  • Arrow keys Move to previous/next entry.
  • PgUp/PgDown Move ten lines up/down.
  • Home/End Move to the beginning/end of list.

Actions

  • F1 Toggle this help screen
  • F2 Loop between title and in-programs screen shots
  • F3 Show program info
  • F5 Run configuration program
  • F10 Exit this program
  • Enter Launch selected list entry

Search & filtering

Type text to automatically filter out entries that does not match search string in a case-insensitive manner.

Lists

You can create lists by making a directory in .\LISTS\ with the name you want for list:

.\LISTS\LIST_DIRECTORY
    LIST.TXT  list entries definition
    TITLES\   programs titles screens
    IN_PROGS\ in-programs screen-shots
    INFO\     programs info files

LIST.TXT

List of entries, one per line, with these columns:

  • absolute path with drive letter
  • executable filename
  • setup program filename (if exists)
  • number of cycles
  • program title

Lines that starts with # character will be recognized as comments.

Each column must be separated by one or more white-space characters (spaces or tabs).

Executable filename is the executable or batch file to be used to launch the program. Extension is mandatory.

Setup filename is the executable or batch file to be used to setup the program. When setup program not exists a - character must be specified. Extension is mandatory.

The cycles will be used inside DOSBox to automatically set correct emulation speed. If zero is specified 'auto' emulation speed will be set.

The program title will be read until end-of-line character or end-of-file, so it can contains any character.

TITLES subdirectory

This directory will contains optional programs titles screen-shots as an standard 4 bits-per-pixel uncompressed Windows bitmap. Only first 14 colors can be used, 2 colors are reserved by the user interface of this program. Width of the image must be 320 pixels.

IN_PROGS subdirectory

This directory will contains optional in-programs screen-shots with the same format and size of title screen-shots.

INFO subdirectory

This directory will contains optional simplified markdown files what will describe specific program usage, options, keyboard shortcuts or notes, with a maximum line length of 38 characters, markdown formatting excluded.

NOTE: titles, in-programs and info filenames must match the inner directory name of the absolute path specified in LIST.TXT file.

How to compile

You need the Borland C++ 3.0 development environment to be able to compile the program from source. At the moment the code is not fully compatible with other compilers, so executables are included.

There are two projects, UI.PRJ and RLOADER/RLOADER.PRJ, both of which can be opened in the IDE and compiled. The RLOADER.EXE executable needs to be copied to the root folder and that's what needs to be run.

License

MIT License, Copyright (c) 2021 Marco Sacchi

rloader's People

Contributors

marco-sacchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

blazejosp

rloader's Issues

Preserve thumbnails display preference when navigating the list

To avoid the user having to toggle from title to in-program preview each time he moves to a new item in the list, it is necessary to keep the user's display preference.

If the preference is not available for the currently selected item, the title preview will be displayed by default.

Implement a critical error handler

it is necessary to implement a critical error manager (int 24h) to manage any disk access problems in the file open/selection/save view which displays a modal message box with the error description and the buttons with the actions that can be taken.

Standard theme definition

Define a standard color scheme for text-mode UI that identifies:

  • standard state
  • focused/current item state
  • pressed/selected item state

Verify that the accelerator / highlighted text is highlighted relative to the rest of the text.

Allow rloader to run from other directory

rloader is designed to be run from the directory it is in, otherwise ui.exe will not be found. To make it easier to use it should be allowed to run from any directory.

To do this, simply modify the main.asm launcher in one of the following ways:

  • verify that argv[0] always contains the entire path to the executable, obtaining the path that contains the executable
  • check that there is an environment variable RLOADER_PATH which will be set by the user with the path where rloader.exe is.

Set the current working directory to path.

Implement abstract control

Implement control class as base class for all TUI library controls.

It must include the implementation of:

  • setting the unique identifier
  • accelerator character setting
  • setting of background and text colors
  • flag that identifies if the control can receive focus
  • methods for navigating the controls tree
  • methods to add / remove child controls
  • methods to manage the trigger of an accelerator
  • methods for receiving messages from the TUI library
  • calculation of the repaint rectangle in absolute coordinates, calculating it based on the position of the parent controls

List files must allow empty lines

When loading list files, lines starting with # and containing white-spaces are discarded, but not empty ones (zero length).

The latter must also be ignored.

Implement label control

Implement non-interactive (and non-focusable) label control in TUI library, with support for both text and 2-bits graphics mode.

Implement open/select/save file dialog.

Implement a dialog for opening / selecting and saving a file.

The window must contain the following controls:

  • editbox for entering the file name or wildcard to filter the displayed files
  • listbox to view files in the current folder
  • listbox for viewing the drives and folders of the current folder
  • open, save and cancel buttons

The difference in behavior between opening and saving consists in checking that the file exists when pressing the open / save button.

When moving in the file list or when changing directories the editbox must be synchronized accordingly, displaying the name of the selected file.

When in save mode, display a message box to confirm overwriting if the file already exists.

Implement message box

Implement a class uimsgbox derived from uiview to manage messageboxes.

Required features:

  • customizable window title
  • text message with word wrap
  • be able to specify standard buttons and buttons with customized text
  • automatic calculation of window size and position

Make thumbnails loading more efficient

If you hold key up or key down in text mode, the browsing is very fast.

In graphical mode it is slow because it tries to load thumbnail even you hold key down.

Two solutions:

  1. load thumbnail only on key up event
  2. implement background timer which will load the thumbnail with some delay (async)

Implement view abstract class

Create an abstract view class, to define a window or dialog box, which will receive events from the TUI library.

The view class will always contain an instance of the window control, and classes that inherit it will contain instances of the window's child controls.

It will define a pure virtual function defined like this:

virtual bool_t on_action(uiwindow *window, action_t *action) = 0;

to receive only the actions from the window or from the controls it contains.

And the following methods:

  • open() to open the window, draw all the contained controls, and give focus to the first control that can receive it.
  • close() to close the window, without deallocating resources, so that the values/states of the controls can be read or returned to the parent view.

Feature Offer: RLoader list generator

Let's say you have your nice list of long folder names with DOS games in /home/user/DIST/GAMES

➭ ls -lah
total 0
drwxr-xr-x    6 user  staff   192B 31 oct 17:24 .
drwx------+ 177 user  staff   5,5K 31 oct 17:24 ..
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 Commander Keen
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 Destruction Derby
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 Duke Nukem 3d
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 Teenage Mutant Turtles 1

I created an automatic list generator using python
https://github.com/jsmolina/simple-menu-dos-launcher/blob/main/scripts/rloadergen.py

Example usage:
python3 rloadergen.py -i /home/user/DIST/GAMES -o /Users/jsmolina/OUT -d c:\menu

It scans the list of directories with long names, and copies such games to dos short names and generates the LIST.txt automatically. It will try to guess the executable, and ask you if it is ambiguous.
So it will generate in the directory /Users/jsmolina/OUT/GAMES something like this:

➭ ls -lah
total 0
drwxr-xr-x    6 jordism  staff   192B 31 oct 17:33 .
drwx------+ 177 user  staff   5,5K 31 oct 17:24 ..
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 CKEEN
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 DDERBY
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 DUKE3D
drwxr-xr-x    2 user  staff    64B 31 oct 17:24 TMNT

And in /Users/jsmolina/OUT/LISTS/PCXT
LIST.TXT, ....

If you are interested, I could add in a Pull request or just take it directly to your repo and do any modification you might consider interesting (like allowing passing the LIST name on the commandline, or asking you about cycles).

it fastens a crazy lot the generation of lists.

Display the item info on the right side of the user interface

NOTE: this implementation requires the management of the focus between the list frame and the info frame (if the info frame can scroll). Before starting development, it may be necessary to complete the TUI library to have consistent UI behavior.

Graphical user interface:

  • move the screenshot display and the display of messages to the top right corner
  • show the info in frame with scrolling to the bottom right corner.

Text-mode interface:

  • replace the logo on the right with a full-height frame with scrolling containing info
  • check where messages are currently displayed

Thumbnail cache to speedup rendering

When emulating an 80386, loading and displaying a thumbnail become really expensive due to re-coding during load in preparation of rendering to video memory.

This issue can be solved in two ways:

  • caching the thumbnails at the cost of doubling the disk space
  • displaying the thumbnail after a timeout.

Implement listbox control

Implement a listbox control to override game list management.

Provide the following features:

  • scrolling of items by arrows, page up / down, home / end
  • jump to a specific item by typing the first letters
  • highlighting of occurrences in items of a specific string
  • ability to hide items that do not match the string used for highlighting
  • ability to view items on multiple columns (useful for rendering a list of files)

Crash / Memory error?

330 items, BMP folder is 24MB => it will crash. Is my LIST.TXT badly formatted or what is happening? I'm running inside DosBox just to test it now. Example list is working.

LIST.TXT

Implement button control

Implement button control in TUI library, with support for both text and 2-bits graphics mode.

Requested action handling:

  • trigger button press on SPACE or ENTER key press/release
  • trigger button press using ALT+accelerator character

Detect when cycles are adjusted by the user

To simplify the updating of the list files, it would be optimal if, upon returning to the program, the configured cycles are compared with those actually in use in DOSBox and updated accordingly if the user confirms.

Implement window control

Implement a window control with a text caption.

Actions required:

  • methods for managing the focus of the contained controls
  • method for returning the control that currently has focus
  • method to return the control corresponding to the specified accelerator character, respecting the flag that identifies if a control can receive the focus

Implement a custom keyboard handler

Implement a keyboard handler in order to have more precise control of the keys pressed, repeated, released and the currently pressed (SHIFT, CTRL, ALT) and locked shifts (CAPS LOCK, NUM LOCK, SCROLL LOCK, PAUSE. INSERT).

Define a data structure that contains:

  • the ASCII code
  • the scan code
  • a virtual code (which normalizes the value of the key regardless of the pressed shifts or other modifiers)
  • the pressed shifts
  • the locked shifts

Text mode: not working on CGA cards

Describe the bug
I would expect that textmode works on CGA mode, but it shows garbled screen intead.

To Reproduce
Steps to reproduce the behavior:

  1. Open any emulator (86box, pcem) or real PCXT.
  2. execute rloader.
  3. See error

Expected behavior
Garblet text is happening

Screenshots
image

Environment

  • Running on: any PCXT
  • OS: any msdos version

Additional context
Add any other context about the problem here.

Implement editbox control

Implement an editbox control in the TUI library that represents a single-line text entry field.

Required features:

  • specify a maximum length of the text string to simplify memory allocation management
  • manage the movement of the cursor with the arrow keys, home, end
  • manage insert or overwrite modes
  • manage the scrolling of the text inside the field by displaying overflow indicators on the right and left

RLoader.exe eat an entire segment causing a lot of games don't run

Hi, thank you for a great launcher. In order to use it, there is one thing a bit problematic:

These games run without issues if I exit RLoader, but inside RLoader they fail to run and you are returned back to RLoader menu. Did you have a chance to try any of these? I have like 622kb of free conventional memory. I tried EMS/XMS as well. One game (Cannon Fodder) prints that there is not enough memory to run inside RLoader. But it will run without RLoader right after I exit RLoader.

I tried to run it several times and use Pause key to get print screen for you. It happens on native machine as well as in DosBox.
cannon_fodder

This quite famous DOS games won't run:

  1. Lotus
  2. Lost Vikings
  3. Cannon Fodder
  4. Alone In The Dark
  5. Chaos Engine
  6. Skyroads

Interesting is that Doom and Command & Conquer will run. The list is bigger, this is just what I remember now. It might be there is something residential that cause the issues or some vector has been modified and DOS4GW will have a problem (something that some file managers can cause - like Norton Commander).

I think the only solution for this would be to have some BAT file automatically run after you exit RLoader. When you choose game, RLoader would overwrite this BAT file to contain launch information for that game and then exit itself. This way it would work on principle of simple BAT file launching a game, nothing resident in memory. Because as you said, it takes only about 11kb of memory (if I remember correctly)...so the problem might be in Borland compiler itself and the way how it works with memory. There might be some magic compiler parameter or some smart workaround on a code level. But right now it will run only a few games.

Implement main message loop and dispatcher

Implement the main loop of sending and receiving messages with the following characteristics:

  • send low-level messages to the controls
  • receive from the controls the actions generated in response to low-level messages
  • send the actions from the descendant controls of the window linked to the view to the uiview::on_action function.

For simplicity of implementation, given the needs of RLoader, all views will be modal.

One view can open another. At the close, an event will be sent to the view previously in focus, allowing to read the values/states exposed by public methods from the closed view.

Add text mode only UI

For maximum compatibility with old real hardware or emulation of low end machine, make a text mode-based UI without display of thumbnails.

Since BIOS calls have been used, the required changes should be minimal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.