Re: [ql-users] QLWA documentation

2003-02-08 Thread Wolfgang Lenerz
On 7 Feb 2003, at 13:26, Jerome Grimbert wrote:

 

 Thanks. At least it clarify a little the structure of the first sector of the file 
system.
 (but qwa.pflg for instance lie on the partition list (which I luckily already
 found and understood) on the first physical sector. It should never appears in
 the first sector of the filesystem.

Here is some info I have on the first sector.
Do you need info on the BGM / GEM/ XGM partitioning scheme 
(if I can find it)?

Wolfgang
-
www.wlenerz.com


Main header of device
+00 longQLWA
+04 wordlenth device name
+06 20 bytesASCII device name
+1A word ?
+1C wordrandom number
+1E wordaccess counter
+20 word ?
+22 wordnumber of sectors (512 bytes) in cluster
(4 = 2048 bytes)
+24 3 x word   ?
+2A wordtotal clusters   (1)
+2C wordfree clusters(1)
+2E wordsize of FAT?
+30 word0001 ?
+32 wordpointer to first free cluster (2)
+34 wordpointer to main directory cluster (2)
+36 longlenth of main directory +header
+3A 3 x word   ?
+40 words   linked cluster pointer map  (3)
 
(1) virtual values if device 33 MB
 
(2) if cluster = 2048 bytes (h800) then pointer x h800 = address
 
(3) Linked cluster pointer map:
 
+0040 word pointer to next cluster or  if end
 
+0042 word pointer to next cluster or  if end
 
...
 
+ word same until all clusters are pointed
 
Example reading main directory (win about 20M):
 
+0022: 0004  cluster = h800
 
+0034: 001A  x800 = address  hD000 = DIR
 
now look at (001A x 2 + h40 = 0074) if  then main directory has
no more clusters else for exemple:
 
+0074: 1939 ; x800 = address hC9C800 more entries
 
now look at (1939 x 2 + h40 = 32B2)
 
+32B2: 2605 ; x800 = adress h01302800 still entries
 
now look at (2605 x 2 + h40 = 4C4A)
 
+4C4A:  no more cluster: end of main directory
 


Structure of directories:
DIR+00  64 bytesspace for header (not used)
DIR+40+00 long  lenth of file (+header)
DIR+40+04 word  filetype (0=data, 1=exe-file,
h00FF=subdirectory)
DIR+40+06 word  generally  sometimes 0318
DIR+40+08 word  dataspace if exe-file else 
DIR+40+0A word  generally  sometimes 0318 if exe-file ?
DIR+40+0C word   ?
DIR+40+0E word  file name lenth
DIR+40+10 36 bytes  ASCII file name
DIR+40+34 long  date or   if subdir
DIR+40+38 word  file version
DIR+40+3A word  pointer to first file cluster (4)
DIR+40+3C 2 x word    ?
  
 
(4) Structure
 of file:
 
FILE+00 64 (h40)bytes of space for not used header (only in the first
cluster of file)
FILE+40 h7C0bytes of data
then search next adress through
clusterpointer: see example
 
adress+00 h800  bytes of data
until pointer = 



number of sectors = number of clusters * nbr_of_sects in clusters

  $8C00

space need for FAT
= 2 bytes per cluster = 71680 bytes = 140 ($8c) sectors
   + $40 for header = 141 ($8d) sectors


how to find a cluster in absolute positioning:


cluster number * 512* nbr_of_sects_in_cluster



Re: [ql-users] Progress bar

2003-02-08 Thread Dilwyn Jones

Malcolm Cadman wrote:

 Has anyone written a progress bar in SuperBASIC ?

 To inform the user of the progress made during a longish operation
like
 processing a file.

 A graphical presentation would also be useful.

 0% ...100%

 ( Crude ASCII illustration above ).
Here are a few ideas for progress bars which I have written. They are
graphical bars in the top left corner of window channel #0. The first
listing sets out the theory for an elapsed time bar, which you can
study and adapt to your own needs. The actual theory is that you
decide on the width of the bar in pixels, then take the total amount
of time that is to represent (in seconds) and divide the width by the
number of seconds to get the number of pixels per second, which may
well be a non-integer like 1.5 pixels per second. Then for each call
to the progress indication, you multiply the elapsed time by the
number of pixels per second and use BLOCK to draw a bar of that width.
A little bit of care is needed if the bar is to be width 0 pixels as
not all versions of S*BASIC will draw a BLOCK of 0 piel width without
an error, also you may wish to draw a block of the full width in the
background colour if elapsed time is 0 and the indicator is likely to
cycle round to 0 again during operation (see example 3 below). The
REMarks should show how it works.

100 REMark graphical progress bar
110 elapsed_col= 4 : REMark elapsed time shown in this colour
120 background_col = 2 : REMark total time length shown in this colour
130 bar_width  = 100 : REMark pixels representing total time
140 bar_height = 10  : REMark pixels height of bar
150 CLS #0 : INPUT #0,'Time to represent  ';time : REMark seconds
160 pix_per_second = bar_width / time : REMark number of pixels
representing one second
170 CLS #0 : PRINT #0,'0%';
180 BLOCK #0,bar_width,bar_height,12,0,background_col : REMark this
bar shows the full time period
190 CURSOR #0,12+bar_width,0 : PRINT #0,'100%'
200 start_time = DATE : REMark time at which we started, err, timing
210 REPeat loop
220   elapsed_time = DATE-start_time : REMark how far have we got?
225   elapsed_pix = pix_per_second*elapsed_time : REMark how many
pixels represent this time?
227   IF elapsed_pix  bar_width THEN elapsed_pix = bar_width : REMark
might just get larger than maximum time if we check at the tick of a
second
230   BLOCK #0,pix_per_second*elapsed_time,bar_height,12,0,elapsed_col
: REMark the elapsed time bar
240   IF elapsed_time = time THEN EXIT loop : REMark finished, exit
250 END REPeat loop
260 PRINT #0,'Time finished.'

*End of listing one*

The next listing shows how to generalise the progress bar for a set
number of operations, not just time based. The procedure
SETUP_PROGRESS_BAR initialises things, then the SHOW_PROGRESS routine
has two parameters, the first is the number of steps completed, the
second the total number of steps to be represented. Although the
example again reveolves around time, this modification allows it to be
more easily adapted to show 'steps' rather than time units, e.g. if
you know you have to write 10,000 strings to a file, you could insert
a call to SHOW_PROGRESS strings_done,1. If this slows things down
too much, a simple MOD test will allow the loop to only call the
routine as often as you feel it needs to be updated (e.g. update only
every 100 string writes):

IF (strings_done MOD 100) = 0 THEN Show_PRogress strings_done,1

100 REMark graphical progress bar
110 CLS #0 : INPUT #0,'Time to represent  ';time
120 Setup_Progress_Bar
130 start_time = DATE
140 REPeat loop
150   elapsed_time = DATE-start_time
160   Show_Progress elapsed_time,time
170   IF elapsed_time = time THEN EXIT loop
180 END REPeat loop
190 PRINT #0,'Time finished.'
200 :
210 DEFine PROCedure Setup_Progress_Bar
220   done_col = 4
230   background_col = 2
240   bar_width = 100
250   bar_height = 10
260   CLS #0 : PRINT #0,'0%';
270   BLOCK #0,bar_width,bar_height,12,0,background_col
280   CURSOR #0,12+bar_width,0 : PRINT #0,'100%'
290 END DEFine Setup_Progress_Bar
300 :
310 DEFine PROCedure Show_Progress (done,steps)
320   IF done  0 THEN BLOCK
#0,done*bar_width/steps,bar_height,12,0,done_col
330 END DEFine Show_Progress

Finally, a silly example showing how to use three progress bars to
represent a weird kind of digital clock. Three progress bars represent
hours elapsed today, minutes elapsed and seconds elapsed. Compile this
and execute it (unlocked if using pointer environment to allow it to
overwrite the display EXEP sillyclock_obj,U)

100 REMark graphical progress bars used as silly digital clock!
120 Setup_Progress_Bars
130 start_time = DATE
140 REPeat loop
150   t$ = DATE$
160   hr = t$(13 TO 14) : Show_Progress hr,24,0 : REMark hours
170   mi = t$(16 TO 17) : Show_Progress mi,60,1 : REMark minutes
180   se = t$(19 TO 20) : Show_Progress se,60,2 : REMark seconds
190 END REPeat loop
200 PRINT #0,'Time finished.'
210 :
220 DEFine PROCedure Setup_Progress_Bars
230   done_col = 4
240   

Re: [ql-users] Progress bar

2003-02-08 Thread John G Hitchcock

Re;
This email has turned out a bit longer than I thought (sorry
everyone
===

No probs Dilwyn. Thanks.

John in Wales



Re: [ql-users] Progress bar

2003-02-08 Thread Malcolm Cadman

In article [EMAIL PROTECTED], Timothy
Swenson [EMAIL PROTECTED] writes

At 08:47 PM 2/7/2003 +, you wrote:

Hi,

Has anyone written a progress bar in SuperBASIC ?

With SSB, I wrote a bar the progressed a single character for every 10 
lines of code processed.  Since the program had no idea of how large the 
file being processed is, I could not guess a percent.  With some work, it 
could be done.

Yes, that could suit my purpose too ... as I am converting a file from
one form to another, and the program doesn't know how large the file
being processed is.

At present I just a 'please wait' notice.

A line showing that work is being done is better than the software just 
sitting there looking like it has frozen.

Yes.

Sun used a spinner to show work being done.  Basically it's a dash (-) then 
a slahs (\) then anther dash, and then the other slash (/).  When printed 
at the same location, it looks like it's spinning.

Umm ... a simple solution too.

-- 
Malcolm Cadman



Re: [ql-users] Progress bar

2003-02-08 Thread Malcolm Cadman

In article [EMAIL PROTECTED], [EMAIL PROTECTED] writes
In a message dated 07/02/03 20:50:18 GMT Standard Time, [EMAIL PROTECTED] 
writes:


 Hi,
 
 Has anyone written a progress bar in SuperBASIC ?
 
 To inform the user of the progress made during a longish operation like
 processing a file.
 
 A graphical presentation would also be useful.
 
 0% ...100%
 
 ( Crude ASCII illustration above ).
 

Hmm - there is one used in Q-Route, if you want me to look out the source 
code...

Ah ... I figured somebody had already got there.

-- 
Malcolm Cadman



Re: [ql-users] Aurora/Qcdeze

2003-02-08 Thread Tony Firshman

On  Sat, 8 Feb 2003 at 16:38:45, Arnold Clarke wrote:
(ref: 002001c2cf90$a83ff800$949d8cd4@ArnoldClarke)


I have a ROMdisq how do I connect it to the Aurora.
If you had Mplane you would have a rom socket on it (8-)#

As you have Qplane, use an Aurora adaptor - £3 from me.
(or a s/h qubbesoft adapter)

Unfortunately Aurora does not fit the correct connector so it is
possible to insert the worng way around.
My adapter is inserted with the RomDisq fitted over the pcb.

If you use the qubbesoft adapter, them it is fitted with the RomDisq the
other way - ie over empty space.

Don't forget that Qubide default jumper setting disables the rom port -
you may have to change that.
-- 
 QBBS (QL fido BBS 2:252/67) +44(0)1442-828255
 tony@surname.co.uk  http://www.firshman.co.uk
   Voice: +44(0)1442-828254   Fax: +44(0)1442-828255
TF Services, 29 Longfield Road, TRING, Herts, HP23 4DG