Desktop for CF/SD cards, Datacentre RAM/USB & MMC cards

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
rharper
Posts: 348
Joined: Sat Sep 01, 2012 5:19 pm
Location: Dunstable
Contact:

Desktop for CF/SD cards, Datacentre RAM/USB & MMC cards

Post by rharper » Wed Feb 14, 2018 5:45 pm

Here is Desktop v3.
New features:
1. Point & click interface.
2. Integrated with Browser software with automatic retention of input device and colours.
3. 6502 co-processor compatible (See notes).
4. Built in *ROMS, load ROM image to SWRAM, COPY and ABR lock/unlock.
5. Configure foreground and background colours.
6. Various bug-fixes but there are probably some new bugs.

Versions for input from keyboard, analog & switched joysticks and mouse/trackerball.
Versions for:
1. ADFS +/- IDE CF/SD card (adfs-dtop3adm.zip)
2. Datacentre RAM+USB drive (ramusb-dtop3ssd.zip)
3. MMC cards (mmc-dtop3ssd.zip)

Notes:
1. Read the *READ* files before use.
2. Switched joysticks are not 6502 co-processor compatible.
3. An ADFS CF card system (e.g. Datacentre) on a BBC Model B with DFS and ADFS1p33 will have PAGE too high for the ADFS software which may give 'No Room' or 'BAD MODE' errors.
Solutions:
a) Switch to ADFS1p32 in SWRAM to allow all the Desktop+Browser software to run.
b) Use Advanced ROM Manager (ARM) to *KILL other filing systems.
c) Use the basic ADFS Desktop3 in folder DESKTOP3SP & the MODE3 CF card browser.
If there is not sufficient memory GO-CF3 will load the non-point & click CF-MODE3.
4. The Desktop v3 in folder DESKTOP3SP is for systems without IDE CF/SD cards.
5. The adfs-dtop3adm.zip is ready for burning to a floppy with OmniFlop.
To run with BeebEm or Elkulator you will need to rename it to .adf, I find Windows7 does not change the type (adm to adf) when changing the name extension so I use Linux. There is probably a way to do this under Windows I don't know.
6. The software uses J.G.Harston's MOUSROM.
There is no Mouse version for the Electron.
7. The software has not been tested on all combinations of hardware!

Ray :D
Edit: Bugfix updates - Running an 'Application' now sets the Drive/Directory before launching the file.
Attachments
ramusb-dtop3ssd.zip
(86.9 KiB) Downloaded 5 times
mmc-dtop3ssd.zip
(86.65 KiB) Downloaded 5 times
ADFS-DTOP3adm.zip
(33.59 KiB) Downloaded 6 times
Last edited by rharper on Mon Apr 30, 2018 4:45 pm, edited 1 time in total.
Raycomp

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

Re: Desktop for CF/SD cards, Datacentre RAM/USB & MMC cards

Post by jgharston » Wed Feb 14, 2018 8:30 pm

Some initial notes:

I couldn't get keyboard operation to work. I hammmered and hammered away at the RETURN key and nothing happened.

You find out what platform you're running on with OSBYTE 0, not by peeking random memory locations.

A%=0:X%=1:os%=((USR&FFF4)AND&FF00)DIV256

then later do things like:

ROMT%=&2A1:IF os%=1 THEN ROMT%=&2A0

You scan for the contents of the catalog using the API calls that scan the contents of the catalog.

I think you've got code that's trying to do ROM selection on Elks and non-Elks. The simplest way to do this is not to have completely different bits of code, but something like this:

.SelectROM :\ X=ROM to page in
LDA #12:JSR SelectROM2:TXA
.SelectROM2
STA &F4:STA &FE30:RTS

IF os%=1 THEN SelectROM2?3=5


You have an ON GOTO that just jumps to a load a CHAINs. A neat way of doing this in a neater way is something like:

F$=MID$("DT-KEYB DTANALG DTSWTCH DTANLGS DTMOUSE",Z%*8+1,8)
CHAIN F$

or even just:
CHAIN MID$("DT-KEYB DTANALG DTSWTCH DTANLGS DTMOUSE",Z%*8+1,8)

In fact, it looks like DT-KEYB DTANALG DTSWTCH DTANLGS DTMOUSE are actually 99.99% identical. I've been going through the listings and haven't yet actually found where they are different. It would be a lot simpler to have one program that does the 1% different actions by doing those specific actions differently.

If the 1% non-common code gets larger, there are techniques to dynamically load small snippets to common code code.

snippet$="filename of the snippet code you want"
ok%=TRUE:ON ERROR ok%=FALSE
IF ok% THEN PROCblah:REM Do a test call of a snippet function
ON ERROR OFF
IF NOT ok% THEN OSCLI "LOAD "+snippet$+" "+STR$~(TOP-2):RUN


This is similar to using overlays, and is similar to building code from libraries, but changes libraries dynamically.

PRINT "ERR=",ERR,"ERL=",ERL gives
ERR=________17ERL=______1780 (_ representing space)
which is probably not what you intend.

Some of your punctuation is wrong. In English you write, eg, "Do this? (Y/N)" not "Do this (Y/N) ?"

I can't remember where it was, but it asked me something, I replied NO, and it didn't like it. If you prompt a user with a yes/no? question you are explicitly instructing the user to answer YES or NO. If you are *not* wanting the user to respond YES or NO, you must *not* prompt with a yes/no question.

Filename? --- is instructing the user to answer YES or NO
Sideways RAM? --- is instructing the user to answer YES or NO

Filename: --- is prompting the user to enter a filename
Sideways RAM bank: --- is instructing the user to enter a sideways RAM bank identifier

P%=osd
[OPT2
EQUB0
EQUDres
EQUD1
]

Beg pardon? Where's the code? Poking memory using the assembler? Just do ?osd=0:osd!1=res:osd!5=1

Is line 1730 supposed to have an embedded CLS character in it? ;)

By convention, ROMs are listed 15 down to 0, not 0 down to 15.

Code: Select all

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

rharper
Posts: 348
Joined: Sat Sep 01, 2012 5:19 pm
Location: Dunstable
Contact:

Re: Desktop for CF/SD cards, Datacentre RAM/USB & MMC cards

Post by rharper » Thu Feb 15, 2018 2:48 pm

jgharston wrote: I couldn't get keyboard operation to work. I hammered and hammered away at the RETURN key and nothing happened.
The first Note says read the *READ* files, where it says to use SHIFT - because ergonomically I find it is easier to hit SHIFT with a thumb when using the cursor keys for navigation with fingers.
jgharston wrote: You find out what platform you're running on with OSBYTE 0, not by peeking random memory locations.
I only need to identify an Electron - so checking for an "E" in the OS where it says "Electron" seemed as quick as anything else. Not random!
jgharston wrote: You scan for the contents of the catalog using the API calls that scan the contents of the catalog.
Under ADFS that is essentially what is done - A%=8 & CALL &FFD1 with the
P%=osd
[OPT2
EQUB0
EQUDres
EQUD1
]
to set up the block.
Not my code, pinched from someone else!
I tried to get this working under Datacentre RAM but couldn't hence the different approach.
However, I will try to get the code you provided the link for working under Datacentre RAM.
jgharston wrote: I think you've got code that's trying to do ROM selection on Elks and non-Elks. The simplest way to do this is not to have completely different bits of code, but something like this:
.SelectROM :\ X=ROM to page in
LDA #12:JSR SelectROM2:TXA
.SelectROM2
STA &F4:STA &FE30:RTS

There are not different bits of code. It just runs the electron specific code to page out BASIC first before carrying on with the common code to page in the required ROM and do whatever is required. The electron code snippets are taken from the user guide for Dave Hitchin's ABR cartridge.

jgharston wrote: You have an ON GOTO that just jumps to a load a CHAINs. A neat way of doing this in a neater way is something like:

F$=MID$("DT-KEYB DTANALG DTSWTCH DTANLGS DTMOUSE",Z%*8+1,8)
CHAIN F$

or even just:
CHAIN MID$("DT-KEYB DTANALG DTSWTCH DTANLGS DTMOUSE",Z%*8+1,8)

In fact, it looks like DT-KEYB DTANALG DTSWTCH DTANLGS DTMOUSE are actually 99.99% identical. I've been going through the listings and haven't yet actually found where they are different. It would be a lot simpler to have one program that does the 1% different actions by doing those specific actions differently.

If the 1% non-common code gets larger, there are techniques to dynamically load small snippets to common code code.

There are only 3 CHAINs (for a selected BASIC file or a linked application) 2 in one ON GOTO and one in another procedure. The other GOTO's do a variety of other actions - show a text file on screen, etc.
Yes, the only real difference between DTOP-KEYB, etc. is the routine to collect the input values for the pointer.
Dynamically loading the required code would work nicely but is less straight forward for someone who needs to keep it as simple as possible.

jgharston wrote:Some initial notes:
Some of your punctuation is wrong. In English you write, eg, "Do this? (Y/N)" not "Do this (Y/N) ?"

I can't remember where it was, but it asked me something, I replied NO, and it didn't like it. If you prompt a user with a yes/no? question you are explicitly instructing the user to answer YES or NO. If you are *not* wanting the user to respond YES or NO, you must *not* prompt with a yes/no question.

Filename? --- is instructing the user to answer YES or NO
Sideways RAM? --- is instructing the user to answer YES or NO

Filename: --- is prompting the user to enter a filename
Sideways RAM bank: --- is instructing the user to enter a sideways RAM bank identifier

In the context Filename? means "What filename do you want to use?" A Y/N response is meaningless.
Delete? (Y/N) means "Do you want to delete this file? Respond by pressing Y or N key" So the ? goes before Y/N. (Which by convention stand for Yes & No).
It could mean "Do you want to delete this file? Yes or No?" But since I wrote it, it doesn't.
English is like programming there are usually several ways of doing the same thing. None of which are wrong.

jgharston wrote: By convention, ROMs are listed 15 down to 0, not 0 down to 15.

Sorry, didn't know that. Probably an artefact from counting down to zero & BEQ in assembler.
I tend to count from 0 up and prefer reading it that way, so that's how it is.

I do appreciate your comments JGH and am always trying to improve my programming. My assembler has improved even if not my BASIC. However, I will never be as accomplished as yourself.
I am about to write another book which will take 6 to 9 months so except for major bugs will not be updating this software until then.

Ray :)
Raycomp

User avatar
CMcDougall
Posts: 6058
Joined: Wed Feb 02, 2005 3:13 pm
Location: Shadow in a Valley of Scotland
Contact:

Re: Desktop for CF/SD cards, Datacentre RAM/USB & MMC cards

Post by CMcDougall » Thu Feb 15, 2018 5:23 pm

Nice =D>

#5 , for renaming files in Windows, I copy the file to a easy find folder, goto DOS (start cmd), then:
cd / (as always end up bla/bla/bla docs:)
cd easy
rename disc.adm disc.adf

then copy your disc file back to original folder :wink:
ImageImageImage

rharper
Posts: 348
Joined: Sat Sep 01, 2012 5:19 pm
Location: Dunstable
Contact:

Re: Desktop for CF/SD cards, Datacentre RAM/USB & MMC cards

Post by rharper » Sat Feb 17, 2018 2:39 pm

So, I have tried JGH's DFS catalog code and got it working. It made me remember why my osgbpb code did not work OK - it did not pick up subdirectories. JGH's code has a version that does.
Note: The line IF dir% THEN OSCLI "Dir """+STRING$(1+(dir%=34),CHR$dir%)+""" line needs an extra " quote at the end.
However:
1. It works by trying to access 62 potential directories, so is quite slow.
2. With all REM's, spaces etc. removed and the code shrunk, it is still about 200 bytes longer than the current code. In various conditions some parts of the software are only a few bytes from a 'No Room' error.
3. It means that as the catalog is processed instead of seeing it on screen with a manic cursor whizzing about you get BBS (Blank, Boring Screen).
So although the programming might be neater with this code and I'm glad to have it as a future option, for the moment I'm leaving it as it is.
Ray
Raycomp

Post Reply