• Please review our updated Terms and Rules here

Tiny Menu

snq

Experienced Member
Joined
Mar 29, 2009
Messages
164
Location
Sweden, way up north
I wrote a little menu tool for DOS and figured maybe you guys want to take a look at it. I think it's pretty neat, altho not quite finished yet.

I started out with a menu thingy written in C (TC 2), but that ended up being larger than I liked and taking up too much memory, so asm it was. It's been about 10 years since I wrote my last 16 bit program, so it was a fun excercise.
It ended up being about 1.5k in size, and only uses 700-something bytes while executing commands.

I've tested it on DOS 6.22 but it should work on DOS 2 or newer.
Other than that it worked under XP and windows 95 as well. And it should work on 8086 or better. So not exactly the most demanding requirements.

Well here's a link, I hope anyone has some use for this :)
http://www.radeonx.com/dump/tinymenu.zip


Screenshot..
tinymenu.gif


Memory usage :)
tinymem.gif
 
This is awesome, a great little menu for floppy disks!

If you're feeling adventurous, try to optimize it for size a bit more. Currently it takes up 2K on disk, if you can get it to 1536 bytes or smaller, it will take up 1.5K on disk ;-)
 
Hehe, it should definitely be possible to get the size down a bit.. The reason it's just over 1.5 is because I made it 8086 compatible, resulting in some stuff being done in multiple instructions that could be done in a single instruction on 80286 and up.

I'll see what I can do ;) I was thinking of a new version anyway with some more features, but that would probably make it larger.
 
v0.2 forgets to reset the cursor as visible on exit, but otherwise it rocks :)

I disassembled it and took a quick look at the listing but couldn't immediately find how many entries in tinymenu.ini were allowed. What's the upper limit? I ask because I've got nearly 400 games in my e:\games directory and was thinking of writing a small program to auto-scan the directory structure and automatically generate a tinymenu.ini.
 
v0.2 forgets to reset the cursor as visible on exit, but otherwise it rocks :)

I disassembled it and took a quick look at the listing but couldn't immediately find how many entries in tinymenu.ini were allowed. What's the upper limit? I ask because I've got nearly 400 games in my e:\games directory and was thinking of writing a small program to auto-scan the directory structure and automatically generate a tinymenu.ini.
Aha, I'll fix that and upload a v0.21 ;)
The file size limit for tinymenu.ini is 65520 bytes, or better said only the first 65520 bytes will be read from it. The limit for the number of entries is around 8k. So you should be good to go with 400 games, that gives you 164.8 characters per item ;) The next version will also support pgup/pgdn, which I'm sure will come in handy with 400 items.
 
Okay cool, let us know when it's finished. Oh, and fix the cursor restoration problem on CGA if you could (when you exit tinymenu on a CGA system, the cursor is gone).

Once that's done, I'd be happy to write a dumb little scanning program that automatically generates a tinymenu.ini.
 
It might be a while, I'm kind of busy with other projects at the moment. But I'll get to it as soon as I have some time to spare :)
 
Bump! I have a need for this, but can't find the download I made a few years ago, and the original link doesn't seem to be working. Does anyone have a copy of this handy? snq, did you ever make the source available? (if you do, I'd be happy to fix the cursor bug and post an update)
 
I'd get you the source if I could find it, but I'm afraid the PC it's on is still packed down after I moved last winter.
Here's what I found on my local harddrive though:
http://howisbabbyformed.info/tinymenu.zip

That was it, thank you! It's a .com file so I don't need the source, I can fix the cursor issue. If you do eventually find it, seeing it would be great.

The reason I was looking for this is because a friend and I are going to have a fully playable IBM PC/XT and PCjr at next weekend's Midwest Gaming Classic (www.midwestgamingclassic.com) and it's my job to come up with bootable disks that have games to play, and tinymenu fits the bill perfectly.
 
Cool, I'm glad it comes to use!
The original source is probably no more readable than what a debugger or disassembler gives you ;) It's about time I unpack those machines though...
I also found the first version, which IIRC is the same but bigger, but maybe doesnt need modification? Here you go:
http://howisbabbyformed.info/TINYMENU01.ZIP
 
wow this looks very handy, it can launch my commander keen episodes just fine :) thanks!

(it really needed a static EXIT item at the bottom, as it is the "cursor" goes a level down the last item configured and becomes invisible... )
 
Last edited:
Size-wise, that's not too bad :) I used to hard-code self-contained batch menus for similar things, though for size, that wasn't always the best solution for floppies!

Thanks for sharing.
 
Cool, I'm glad it comes to use!

I went ahead and created a pack to supplement tinymenu, which includes a quick program to build a tinymenu.ini file suitable for a floppy disk or single directory (it queries the files and asks for descriptions), the .pas source for it, and a functional, semi-commented disassembly of tinymenu 0.2 that assembles into a functional tinymenu.com. I've attached the .zip file: View attachment tinymutl.zip

I farted out the "scan for files and build a menu" in about 30 minutes, nothing amazing. It's small enough that I'll reproduce it here:

Code:
{Scans a path and builds a TinyMenu .ini file, asking user for descriptions.
Intended usage is to quickly populate a menu for a bootable floppy.
}

program buildini;

uses
  Dos;

var
  oldpath,inipath:pathstr;
  DirInfo:SearchRec;
  inifile:text;
  desc:string;

procedure catalog(fspec:string);
begin
  FindFirst(fspec, AnyFile, DirInfo);
  while DosError = 0 do begin
    Write('Enter description for ',DirInfo.Name,': ');
    readln(desc);
    writeln(inifile,desc,'^',DirInfo.Name);
    FindNext(DirInfo);
  end;
end;

begin
  if paramcount<2 then begin
    writeln('Usage:    buildini [scanpath] [inipath]');
    writeln('Example:  buildini a:\ a:\tinymenu.ini');
    halt(1);
  end;
  getdir(0,oldpath);
  chdir(paramstr(1));
  assign(inifile,paramstr(2)); rewrite(inifile);
  catalog('*.com');
  catalog('*.exe');
  close(inifile);
  chdir(oldpath);
end.
 
Size-wise, that's not too bad :) I used to hard-code self-contained batch menus for similar things, though for size, that wasn't always the best solution for floppies!

Agreed, since files are quantized to 512-byte sectors. tinymenu.com takes up 3 512b sectors, and tinymenu.ini should only take 1 or 2 more. If you wrote 6 or more batch files, you'd already lost to tinymenu ;-)
 
For more space savings the data could be appended to tinymenu.com, that would probably save some code too. Maybe even more so if stored in a more easily parsed or pre-parsed form. I'm sure the size is far from optimal anyway :)
 
While I disassembled it to fix the CGA cursor bug (btw, this is not fixed in the disassembly I provided), I had the secondary motive of seeing if it could be shrunk by replacing code with BIOS routines, since the BIOS is already loaded and "free". That kind of stuff is always a quick easy win. You use the BIOS for keyboard input, writing characters, moving the cursor, scrolling the screen up/down/clearing -- I didn't see anything obvious :) But I was working with a disassembly, so if you ever turn up the nice, original, commented code, I'd be curious to see it. It might be possible to shave another 300 bytes or so off of it and get it down to 1024b.

Most tinymenu.ini files are going to be 512b or smaller so I don't think appending them to the .com will save anything.
 
Back
Top