Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92 » !AWJan92/Goodies/FindDir/!FindDir/DevNotes

!AWJan92/Goodies/FindDir/!FindDir/DevNotes

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199201.adf » January92
Filename: !AWJan92/Goodies/FindDir/!FindDir/DevNotes
Read OK:
File size: 05B0 bytes
Load address: 0000
Exec address: 0000
File contents
 Development Notes
 _________________

 - fopen() seems to have behave strange especially with floppy discs. When
ADFS tries to remove a discname i.e when all eight disc names have been used
and you add a ninth disc it causes fopen to crash FileCore sometimes (on
both read & write). To overcome this use whenever possible RISC OS
read/write file functions. fopen() also requires min 32K free on a disc when
it creates a file to write to. N.B This program was developed with Clib
version 3.50, later versions may correct this bug.

 - When using flex it grabs memory above what you set using wimpslot. Large
memory requests also seem in some cases to require a much larger memory
overhead (over what you actually request) than small memory requests.

 - Message handling is not explained very well in the Prog's reference
manual. When using User_Message_Recorded, if no one accepted your message
you're program will recieve a User_Message_Acknowledged, else User_Message
is sent (in most cases).

 - Since you can't use asd with RISC OS progs you either have to use werr or
you can write debug info to a file. If you use fopen remember to use setvbuf
with _IONBF since if you're program crashes all you're debug info will be
written to file. It will slow I/O however.

 - For sorting use qsort() wherever possible as it is one of the fastest
algorithms. For finding an item in a sorted list there is bsearch() which is a
reasonably fast search alogorithm.
00000000  0a 20 44 65 76 65 6c 6f  70 6d 65 6e 74 20 4e 6f  |. Development No|
00000010  74 65 73 0a 20 5f 5f 5f  5f 5f 5f 5f 5f 5f 5f 5f  |tes. ___________|
00000020  5f 5f 5f 5f 5f 5f 0a 0a  20 2d 20 66 6f 70 65 6e  |______.. - fopen|
00000030  28 29 20 73 65 65 6d 73  20 74 6f 20 68 61 76 65  |() seems to have|
00000040  20 62 65 68 61 76 65 20  73 74 72 61 6e 67 65 20  | behave strange |
00000050  65 73 70 65 63 69 61 6c  6c 79 20 77 69 74 68 20  |especially with |
00000060  66 6c 6f 70 70 79 20 64  69 73 63 73 2e 20 57 68  |floppy discs. Wh|
00000070  65 6e 0a 41 44 46 53 20  74 72 69 65 73 20 74 6f  |en.ADFS tries to|
00000080  20 72 65 6d 6f 76 65 20  61 20 64 69 73 63 6e 61  | remove a discna|
00000090  6d 65 20 69 2e 65 20 77  68 65 6e 20 61 6c 6c 20  |me i.e when all |
000000a0  65 69 67 68 74 20 64 69  73 63 20 6e 61 6d 65 73  |eight disc names|
000000b0  20 68 61 76 65 20 62 65  65 6e 20 75 73 65 64 0a  | have been used.|
000000c0  61 6e 64 20 79 6f 75 20  61 64 64 20 61 20 6e 69  |and you add a ni|
000000d0  6e 74 68 20 64 69 73 63  20 69 74 20 63 61 75 73  |nth disc it caus|
000000e0  65 73 20 66 6f 70 65 6e  20 74 6f 20 63 72 61 73  |es fopen to cras|
000000f0  68 20 46 69 6c 65 43 6f  72 65 20 73 6f 6d 65 74  |h FileCore somet|
00000100  69 6d 65 73 20 28 6f 6e  0a 62 6f 74 68 20 72 65  |imes (on.both re|
00000110  61 64 20 26 20 77 72 69  74 65 29 2e 20 54 6f 20  |ad & write). To |
00000120  6f 76 65 72 63 6f 6d 65  20 74 68 69 73 20 75 73  |overcome this us|
00000130  65 20 77 68 65 6e 65 76  65 72 20 70 6f 73 73 69  |e whenever possi|
00000140  62 6c 65 20 52 49 53 43  20 4f 53 0a 72 65 61 64  |ble RISC OS.read|
00000150  2f 77 72 69 74 65 20 66  69 6c 65 20 66 75 6e 63  |/write file func|
00000160  74 69 6f 6e 73 2e 20 66  6f 70 65 6e 28 29 20 61  |tions. fopen() a|
00000170  6c 73 6f 20 72 65 71 75  69 72 65 73 20 6d 69 6e  |lso requires min|
00000180  20 33 32 4b 20 66 72 65  65 20 6f 6e 20 61 20 64  | 32K free on a d|
00000190  69 73 63 20 77 68 65 6e  0a 69 74 20 63 72 65 61  |isc when.it crea|
000001a0  74 65 73 20 61 20 66 69  6c 65 20 74 6f 20 77 72  |tes a file to wr|
000001b0  69 74 65 20 74 6f 2e 20  4e 2e 42 20 54 68 69 73  |ite to. N.B This|
000001c0  20 70 72 6f 67 72 61 6d  20 77 61 73 20 64 65 76  | program was dev|
000001d0  65 6c 6f 70 65 64 20 77  69 74 68 20 43 6c 69 62  |eloped with Clib|
000001e0  0a 76 65 72 73 69 6f 6e  20 33 2e 35 30 2c 20 6c  |.version 3.50, l|
000001f0  61 74 65 72 20 76 65 72  73 69 6f 6e 73 20 6d 61  |ater versions ma|
00000200  79 20 63 6f 72 72 65 63  74 20 74 68 69 73 20 62  |y correct this b|
00000210  75 67 2e 0a 0a 20 2d 20  57 68 65 6e 20 75 73 69  |ug... - When usi|
00000220  6e 67 20 66 6c 65 78 20  69 74 20 67 72 61 62 73  |ng flex it grabs|
00000230  20 6d 65 6d 6f 72 79 20  61 62 6f 76 65 20 77 68  | memory above wh|
00000240  61 74 20 79 6f 75 20 73  65 74 20 75 73 69 6e 67  |at you set using|
00000250  20 77 69 6d 70 73 6c 6f  74 2e 20 4c 61 72 67 65  | wimpslot. Large|
00000260  0a 6d 65 6d 6f 72 79 20  72 65 71 75 65 73 74 73  |.memory requests|
00000270  20 61 6c 73 6f 20 73 65  65 6d 20 69 6e 20 73 6f  | also seem in so|
00000280  6d 65 20 63 61 73 65 73  20 74 6f 20 72 65 71 75  |me cases to requ|
00000290  69 72 65 20 61 20 6d 75  63 68 20 6c 61 72 67 65  |ire a much large|
000002a0  72 20 6d 65 6d 6f 72 79  0a 6f 76 65 72 68 65 61  |r memory.overhea|
000002b0  64 20 28 6f 76 65 72 20  77 68 61 74 20 79 6f 75  |d (over what you|
000002c0  20 61 63 74 75 61 6c 6c  79 20 72 65 71 75 65 73  | actually reques|
000002d0  74 29 20 74 68 61 6e 20  73 6d 61 6c 6c 20 6d 65  |t) than small me|
000002e0  6d 6f 72 79 20 72 65 71  75 65 73 74 73 2e 0a 0a  |mory requests...|
000002f0  20 2d 20 4d 65 73 73 61  67 65 20 68 61 6e 64 6c  | - Message handl|
00000300  69 6e 67 20 69 73 20 6e  6f 74 20 65 78 70 6c 61  |ing is not expla|
00000310  69 6e 65 64 20 76 65 72  79 20 77 65 6c 6c 20 69  |ined very well i|
00000320  6e 20 74 68 65 20 50 72  6f 67 27 73 20 72 65 66  |n the Prog's ref|
00000330  65 72 65 6e 63 65 0a 6d  61 6e 75 61 6c 2e 20 57  |erence.manual. W|
00000340  68 65 6e 20 75 73 69 6e  67 20 55 73 65 72 5f 4d  |hen using User_M|
00000350  65 73 73 61 67 65 5f 52  65 63 6f 72 64 65 64 2c  |essage_Recorded,|
00000360  20 69 66 20 6e 6f 20 6f  6e 65 20 61 63 63 65 70  | if no one accep|
00000370  74 65 64 20 79 6f 75 72  20 6d 65 73 73 61 67 65  |ted your message|
00000380  0a 79 6f 75 27 72 65 20  70 72 6f 67 72 61 6d 20  |.you're program |
00000390  77 69 6c 6c 20 72 65 63  69 65 76 65 20 61 20 55  |will recieve a U|
000003a0  73 65 72 5f 4d 65 73 73  61 67 65 5f 41 63 6b 6e  |ser_Message_Ackn|
000003b0  6f 77 6c 65 64 67 65 64  2c 20 65 6c 73 65 20 55  |owledged, else U|
000003c0  73 65 72 5f 4d 65 73 73  61 67 65 0a 69 73 20 73  |ser_Message.is s|
000003d0  65 6e 74 20 28 69 6e 20  6d 6f 73 74 20 63 61 73  |ent (in most cas|
000003e0  65 73 29 2e 0a 0a 20 2d  20 53 69 6e 63 65 20 79  |es)... - Since y|
000003f0  6f 75 20 63 61 6e 27 74  20 75 73 65 20 61 73 64  |ou can't use asd|
00000400  20 77 69 74 68 20 52 49  53 43 20 4f 53 20 70 72  | with RISC OS pr|
00000410  6f 67 73 20 79 6f 75 20  65 69 74 68 65 72 20 68  |ogs you either h|
00000420  61 76 65 20 74 6f 20 75  73 65 20 77 65 72 72 20  |ave to use werr |
00000430  6f 72 0a 79 6f 75 20 63  61 6e 20 77 72 69 74 65  |or.you can write|
00000440  20 64 65 62 75 67 20 69  6e 66 6f 20 74 6f 20 61  | debug info to a|
00000450  20 66 69 6c 65 2e 20 49  66 20 79 6f 75 20 75 73  | file. If you us|
00000460  65 20 66 6f 70 65 6e 20  72 65 6d 65 6d 62 65 72  |e fopen remember|
00000470  20 74 6f 20 75 73 65 20  73 65 74 76 62 75 66 0a  | to use setvbuf.|
00000480  77 69 74 68 20 5f 49 4f  4e 42 46 20 73 69 6e 63  |with _IONBF sinc|
00000490  65 20 69 66 20 79 6f 75  27 72 65 20 70 72 6f 67  |e if you're prog|
000004a0  72 61 6d 20 63 72 61 73  68 65 73 20 61 6c 6c 20  |ram crashes all |
000004b0  79 6f 75 27 72 65 20 64  65 62 75 67 20 69 6e 66  |you're debug inf|
000004c0  6f 20 77 69 6c 6c 20 62  65 0a 77 72 69 74 74 65  |o will be.writte|
000004d0  6e 20 74 6f 20 66 69 6c  65 2e 20 49 74 20 77 69  |n to file. It wi|
000004e0  6c 6c 20 73 6c 6f 77 20  49 2f 4f 20 68 6f 77 65  |ll slow I/O howe|
000004f0  76 65 72 2e 0a 0a 20 2d  20 46 6f 72 20 73 6f 72  |ver... - For sor|
00000500  74 69 6e 67 20 75 73 65  20 71 73 6f 72 74 28 29  |ting use qsort()|
00000510  20 77 68 65 72 65 76 65  72 20 70 6f 73 73 69 62  | wherever possib|
00000520  6c 65 20 61 73 20 69 74  20 69 73 20 6f 6e 65 20  |le as it is one |
00000530  6f 66 20 74 68 65 20 66  61 73 74 65 73 74 0a 61  |of the fastest.a|
00000540  6c 67 6f 72 69 74 68 6d  73 2e 20 46 6f 72 20 66  |lgorithms. For f|
00000550  69 6e 64 69 6e 67 20 61  6e 20 69 74 65 6d 20 69  |inding an item i|
00000560  6e 20 61 20 73 6f 72 74  65 64 20 6c 69 73 74 20  |n a sorted list |
00000570  74 68 65 72 65 20 69 73  20 62 73 65 61 72 63 68  |there is bsearch|
00000580  28 29 20 77 68 69 63 68  20 69 73 20 61 0a 72 65  |() which is a.re|
00000590  61 73 6f 6e 61 62 6c 79  20 66 61 73 74 20 73 65  |asonably fast se|
000005a0  61 72 63 68 20 61 6c 6f  67 6f 72 69 74 68 6d 2e  |arch alogorithm.|
000005b0