Easiest hackable Menu

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
User avatar
pau1ie
Posts: 614
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Easiest hackable Menu

Post by pau1ie » Fri Dec 29, 2017 12:50 am

I am working through John's educational archive and have got to a tape which accompanies a book (Basic Graphics and Sound - Addison Wesley) which has over 70 files on side 1. For ease of use with jsbeeb I decided to create an ADFS disc image, as I can create directories with files in, each file being a smallish basic program.

To make it easier to use it strikes me I should create a menu. To save me reinventing the wheel, what is the most easily hackable menu system?
I'm working on http://bbcmicro.co.uk

User avatar
sweh
Posts: 1980
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: Easiest hackable Menu

Post by sweh » Sun Dec 31, 2017 9:33 pm

I put together a very very simple Menu program to work with MB's disks; the "build SSD" routines parsed his disks and generated the data file ("DSKDATA" and "GAMDATA") that the main MENU program used. The code is at https://github.com/sweharris/split_md_dsd

It's not pretty, but it has a simple search, and 'cos it's in BASIC you can modify it easily enough.
Rgds
Stephen

User avatar
jgharston
Posts: 3289
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Easiest hackable Menu

Post by jgharston » Mon Jan 01, 2018 7:40 am

There's some menu programs in Menus.ssd. EcoMenu is the simplest, an ECOnomical menu program that reads a simple text file in each directory describing what to display in that directory.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
pau1ie
Posts: 614
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Re: Easiest hackable Menu

Post by pau1ie » Mon Jan 01, 2018 7:28 pm

Thanks both, I will have a look and see what I like best!
I'm working on http://bbcmicro.co.uk

User avatar
lurkio
Posts: 1814
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Easiest hackable Menu

Post by lurkio » Mon Jan 01, 2018 8:30 pm

pau1ie wrote:Thanks both, I will have a look and see what I like best!
Here's a simple menu prog I used to use BITD:
  • menu.ssd.zip
    DFS .SSD disc-image
    (1.2 KiB) Downloaded 33 times
You can tinker with the function params to change the colours, number of menu items, etc.

:idea:

User avatar
pau1ie
Posts: 614
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Re: Easiest hackable Menu

Post by pau1ie » Fri Mar 23, 2018 10:20 pm

jgharston wrote: EcoMenu is the simplest,
I think I would like to use EcoMenu as I think it allows submenus without having to have a different version in each directory, but I can't figure out the format of the !dirinfo file. If I create a a list of lines, it displays blank lines in the menu, but if you select one, it tries to run it as a program.

Also, can I remove the first menu page which just lists :0?
I'm working on http://bbcmicro.co.uk

User avatar
jgharston
Posts: 3289
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Easiest hackable Menu

Post by jgharston » Sun Mar 25, 2018 4:03 pm

pau1ie wrote:
jgharston wrote: EcoMenu is the simplest,
I think I would like to use EcoMenu as I think it allows submenus without having to have a different version in each directory, but I can't figure out the format of the !dirinfo file. If I create a a list of lines, it displays blank lines in the menu, but if you select one, it tries to run it as a program.
Also, can I remove the first menu page which just lists :0?
On each disk, put a text file '$.!DiskInfo' containing what is on the
disk, and in directories, put a text file '!DirInfo' containing what is in
that directory. The format of each line of the '$.!DiskInfo' file is:
directory,description
or pathname.filename,description
or pathname/filename,description
terminated with a blank line.
Eg:
Programs,Program Area
Games.Menu1,Games Area 1
Printer/$.Menu,Printer Programs
It's a long time since I set anything up with EcoMenu, I'll put together a sample dummy sample.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
pau1ie
Posts: 614
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Re: Easiest hackable Menu

Post by pau1ie » Sat Mar 31, 2018 10:46 pm

Thanks Jonathan, I have got further, but still can't quite suss it out.

If I create a file called !DirInfo with the format you describe, I get a menu, but the maximum number of entries is 20 (Looking at the array definition). I assume the format is actually for !DirInfo

I have created directories called UNIT-01 to UNIT-15. Each of these contain a number of files (Normally 9) three of which are Basic programs to run. So in total there are 75 programs, which is too many for DirInfo. I think I should be able to create a hierarchical structure, but can't work out how. I am having trouble reading the code as well, it is quite terse and uses lots of indirection operators. I think if there is not a !DirInfo file it tries to read all the discs. So I am not sure when it uses the !DiscInfo or why. It is rather unforgiving as it seems to assume any error condition is the one it is expecting rather than an idiot trying to work out how to use the program!

I had a look at the other menus on the disc in case I could use one of those. I then realised, there are two files called MENU and two called MENSYS. It looks like the catalogue is corrupt, or else it is written with a non-acorn DFS. Anyway if you rename one file you can access the other, so I had a play with the ADFS Menu program, but the user interface is horrible, and you can't use a text editor to create the files (The format seems to have binary elements, and the text is all reversed). Any mistake you have to enter the menu option again and type the information in again. And the copy key has been disabled from its normal use, just to force you to type the whole field in again as a punishment for getting it wrong the first time!

Lurkio's one only allows 15 entries, so while usable isn't as configurable as I would have hoped (I would need 16 versions one in the root, and one in each subdirectory). Sweh's one looks promising. I might have to give it a spin in beeb-em (So I can paste in the basic).
I'm working on http://bbcmicro.co.uk

User avatar
pau1ie
Posts: 614
Joined: Thu May 10, 2012 9:48 pm
Location: Bedford
Contact:

Re: Easiest hackable Menu

Post by pau1ie » Sun Apr 01, 2018 10:58 pm

OK, so first 15*3=45, not 75!

The file format is just print# statements, so I can create a basic program to write out the file quite easily. I am using sweh's program, as I can understand it. It can take any number of entries (Well up to 256, which should be plenty) and I can change it because I can understand it, especially now I understand how to create the data files.

Thanks!
I'm working on http://bbcmicro.co.uk

Post Reply