Skip to content

Commit 29188d0

Browse files
Updated to 1.48
1 parent a426f43 commit 29188d0

22 files changed

+420
-313
lines changed

Documentation/Changes.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,8 @@ Bug fixes
10111011
* Some DFS images were producing a "phantom directory".
10121012
* When files were getting written to a DOS image, the same block was being used for each segment of the file resulting in the file being overwritten by itself.
10131013

1014-
1.47.5
1015-
---------------------
1014+
1.48 13th April 2025
1015+
--------------------
10161016
New or improved features
10171017
* Added keyboard shortcuts to the confirm/error/information dialogue boxes.
10181018
* Added a fourth button to the confirm/error/information dialogue boxes.
@@ -1031,6 +1031,7 @@ New or improved features
10311031
* Added a new command to the console, 'type'. This sets the filetype for a file.
10321032
* Some text formatting and improvements in the console text.
10331033
* Wildcards are now accepted for the console commands 'access', 'exec', 'load', 'type' and 'stamp'.
1034+
* Added new commands to the console, 'compact' and 'defrag'. These are identical and will perform a defrag, or compact, the image, if possible.
10341035

10351036
Bug fixes
10361037
* ADFS directories would use the default ID (Hugo, Nick or SBPr/oven) depending on whether it is old, new or big. This would mean that images could end up with a mis-match of IDs, which Arthur ADFS was not keen on.
@@ -1040,6 +1041,7 @@ Bug fixes
10401041
* Creating a new ADFS Old Map image, then adding a new directory, renaming then deleting would fail to delete. This bug is related to the failure to decompact bug.
10411042
* FAT12 HDD sizes of above 31MB were permitted to be created, which will produce invalid images.
10421043
* When changing the load and execution addresses of a file, editing one then clicking on the other would make the one you were editing disappear.
1044+
* Defragging (compacting) an image with no free space would fail and not revert back to the original image. Now, it fails and returns to the original image with no changes made.
10431045

10441046
Platform History
10451047
----------------
-49 Bytes
Binary file not shown.
-14.3 KB
Binary file not shown.

LazarusSource/DiscImage.pas

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
unit DiscImage;
22

33
{
4-
TDiscImage class V1.47 and TSpark class V1.05
4+
TDiscImage class V1.48 and TSpark class V1.05
55
Manages retro disc images, presenting a list of files and directories to the
66
parent application. Will also extract files and write new files. Almost a complete
77
filing system in itself. Compatible with Acorn DFS, Acorn ADFS, UEF, Commodore
88
1541, Commodore 1571, Commodore 1581, Commodore AmigaDOS, Acorn File Server,
99
SparkFS, PackDir, MS-DOS, and Acorn DOS Plus.
1010
11-
Copyright (C) 2018-2025 Gerald Holdsworth [email protected]
11+
Copyright ©2018-2025 Gerald Holdsworth [email protected]
1212
1313
This source is free software; you can redistribute it and/or modify it under
1414
the terms of the GNU General Public Licence as published by the Free
@@ -902,6 +902,8 @@ TFragment = record //For retrieving the ADFS E/F fragment informati
902902
property FormatNumber: Word read FFormat;
903903
property FormatString: String read FormatToString;
904904
property FreeSpaceMap: TSide read free_space_map;
905+
property HDDHeads: Byte read heads;
906+
property HeaderSize: Cardinal read emuheader;
905907
property InterleaveInUse: String read InterleaveString;
906908
property InterleaveInUseNum: Byte read FInterleave;
907909
property InterleaveMethod: Byte read FForceInter
@@ -919,6 +921,7 @@ TFragment = record //For retrieving the ADFS E/F fragment informati
919921
property RootAddress: Cardinal read GetRootAddress;
920922
property ScanSubDirs: Boolean read FScanSubDirs
921923
write FScanSubDirs;
924+
property Sectors: Byte read secspertrack;
922925
property SparkAsFS: Boolean read FSparkAsFS
923926
write FSparkAsFS;
924927
property VersionNumber: Byte read GetRFSVersionNumber

LazarusSource/DiscImageManager.lps

Lines changed: 67 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Version Value="12"/>
55
<ManyBuildModesSelection Value="&quot;Release macOS 64 bit&quot;,&quot;Release macOS 32 bit&quot;,&quot;Release macOS ARM&quot;,&quot;Release Windows 64 bit&quot;,&quot;Release Windows 32 bit&quot;,&quot;Release Linux 64 bit&quot;,&quot;Release Linux 32 bit&quot;,&quot;Release Linux ARM 32 bit&quot;,&quot;Release Linux ARM 64 bit&quot;"/>
66
<BuildModes Active="Native Debugger"/>
7-
<Units Count="45">
7+
<Units Count="44">
88
<Unit0>
99
<Filename Value="DiscImageManager.lpr"/>
1010
<IsPartOfProject Value="True"/>
@@ -19,9 +19,10 @@
1919
<ComponentName Value="MainForm"/>
2020
<HasResources Value="True"/>
2121
<ResourceBaseClass Value="Form"/>
22+
<IsVisibleTab Value="True"/>
2223
<EditorIndex Value="2"/>
23-
<TopLine Value="2948"/>
24-
<CursorPos X="35" Y="2982"/>
24+
<TopLine Value="3540"/>
25+
<CursorPos X="23" Y="3456"/>
2526
<UsageCount Value="200"/>
2627
<Loaded Value="True"/>
2728
<LoadedDesigner Value="True"/>
@@ -30,8 +31,7 @@
3031
<Filename Value="DiscImage.pas"/>
3132
<IsPartOfProject Value="True"/>
3233
<EditorIndex Value="15"/>
33-
<TopLine Value="51"/>
34-
<CursorPos X="17" Y="819"/>
34+
<CursorPos X="12" Y="11"/>
3535
<UsageCount Value="200"/>
3636
<Loaded Value="True"/>
3737
</Unit2>
@@ -55,6 +55,7 @@
5555
<HasResources Value="True"/>
5656
<ResourceBaseClass Value="Form"/>
5757
<EditorIndex Value="32"/>
58+
<TopLine Value="426"/>
5859
<UsageCount Value="215"/>
5960
<Loaded Value="True"/>
6061
<LoadedDesigner Value="True"/>
@@ -82,7 +83,7 @@
8283
<Filename Value="Global.pas"/>
8384
<IsPartOfProject Value="True"/>
8485
<EditorIndex Value="28"/>
85-
<TopLine Value="6"/>
86+
<TopLine Value="109"/>
8687
<CursorPos X="23" Y="26"/>
8788
<UsageCount Value="216"/>
8889
<Loaded Value="True"/>
@@ -198,7 +199,8 @@
198199
<HasResources Value="True"/>
199200
<ResourceBaseClass Value="Form"/>
200201
<EditorIndex Value="9"/>
201-
<CursorPos X="17" Y="258"/>
202+
<TopLine Value="210"/>
203+
<CursorPos X="24" Y="228"/>
202204
<UsageCount Value="206"/>
203205
<Loaded Value="True"/>
204206
<LoadedDesigner Value="True"/>
@@ -275,8 +277,8 @@
275277
<Filename Value="ConsoleAppUnit.pas"/>
276278
<IsPartOfProject Value="True"/>
277279
<EditorIndex Value="1"/>
278-
<TopLine Value="79"/>
279-
<CursorPos X="20" Y="185"/>
280+
<TopLine Value="50"/>
281+
<CursorPos X="12" Y="60"/>
280282
<UsageCount Value="207"/>
281283
<Loaded Value="True"/>
282284
</Unit24>
@@ -296,26 +298,32 @@
296298
<Unit26>
297299
<Filename Value="DiscImage_ADFS.pas"/>
298300
<EditorIndex Value="21"/>
299-
<TopLine Value="4414"/>
300-
<CursorPos X="54" Y="4437"/>
301+
<TopLine Value="2233"/>
302+
<CursorPos X="65" Y="2273"/>
301303
<UsageCount Value="102"/>
302304
<Loaded Value="True"/>
303305
</Unit26>
304306
<Unit27>
305307
<Filename Value="DiscImage_DFS.pas"/>
306308
<EditorIndex Value="26"/>
309+
<TopLine Value="778"/>
310+
<CursorPos X="41" Y="737"/>
307311
<UsageCount Value="102"/>
308312
<Loaded Value="True"/>
309313
</Unit27>
310314
<Unit28>
311315
<Filename Value="DiscImage_C64.pas"/>
312316
<EditorIndex Value="24"/>
317+
<TopLine Value="847"/>
318+
<CursorPos X="25" Y="889"/>
313319
<UsageCount Value="101"/>
314320
<Loaded Value="True"/>
315321
</Unit28>
316322
<Unit29>
317323
<Filename Value="DiscImage_Amiga.pas"/>
318324
<EditorIndex Value="25"/>
325+
<TopLine Value="111"/>
326+
<CursorPos X="26" Y="133"/>
319327
<UsageCount Value="101"/>
320328
<Loaded Value="True"/>
321329
</Unit29>
@@ -379,8 +387,7 @@
379387
<Unit38>
380388
<Filename Value="DiscImage_Published.pas"/>
381389
<EditorIndex Value="17"/>
382-
<TopLine Value="862"/>
383-
<CursorPos X="2" Y="894"/>
390+
<CursorPos X="2" Y="36"/>
384391
<UsageCount Value="119"/>
385392
<Loaded Value="True"/>
386393
</Unit38>
@@ -399,10 +406,8 @@
399406
</Unit40>
400407
<Unit41>
401408
<Filename Value="MainUnit_Console.pas"/>
402-
<IsVisibleTab Value="True"/>
403409
<EditorIndex Value="3"/>
404-
<TopLine Value="355"/>
405-
<CursorPos X="84" Y="381"/>
410+
<CursorPos X="18" Y="396"/>
406411
<UsageCount Value="114"/>
407412
<Loaded Value="True"/>
408413
</Unit41>
@@ -419,133 +424,127 @@
419424
<UsageCount Value="110"/>
420425
<Loaded Value="True"/>
421426
</Unit43>
422-
<Unit44>
423-
<Filename Value="/usr/local/share/fpcsrc/rtl/unix/sysutils.pp"/>
424-
<EditorIndex Value="-1"/>
425-
<TopLine Value="36"/>
426-
<UsageCount Value="5"/>
427-
</Unit44>
428427
</Units>
429-
<JumpHistory Count="30" HistoryIndex="27">
428+
<JumpHistory Count="30" HistoryIndex="29">
430429
<Position1>
431-
<Filename Value="DiscImage.pas"/>
432-
<Caret Line="796" Column="12" TopLine="752"/>
430+
<Filename Value="MainUnit.pas"/>
431+
<Caret Line="3627" Column="7" TopLine="3586"/>
433432
</Position1>
434433
<Position2>
435434
<Filename Value="MainUnit.pas"/>
436-
<Caret Line="7121" Column="44" TopLine="7098"/>
435+
<Caret Line="4526" Column="44" TopLine="4486"/>
437436
</Position2>
438437
<Position3>
439438
<Filename Value="MainUnit.pas"/>
440-
<Caret Line="3153" Column="13" TopLine="3130"/>
439+
<Caret Line="4530" Column="44" TopLine="4490"/>
441440
</Position3>
442441
<Position4>
443442
<Filename Value="MainUnit.pas"/>
444-
<Caret Line="474" Column="16" TopLine="452"/>
443+
<Caret Line="4590" Column="17" TopLine="4549"/>
445444
</Position4>
446445
<Position5>
447446
<Filename Value="MainUnit.pas"/>
448-
<Caret Line="2889" Column="42" TopLine="2848"/>
447+
<Caret Line="4637" Column="41" TopLine="4598"/>
449448
</Position5>
450449
<Position6>
451450
<Filename Value="MainUnit.pas"/>
452-
<Caret Line="2893" Column="51" TopLine="2865"/>
451+
<Caret Line="4689" Column="9" TopLine="4646"/>
453452
</Position6>
454453
<Position7>
455454
<Filename Value="MainUnit.pas"/>
456-
<Caret Line="4943" Column="62" TopLine="4915"/>
455+
<Caret Line="4698" Column="45" TopLine="4658"/>
457456
</Position7>
458457
<Position8>
459458
<Filename Value="MainUnit.pas"/>
460-
<Caret Line="4944" Column="62" TopLine="4915"/>
459+
<Caret Line="4875" Column="42" TopLine="4834"/>
461460
</Position8>
462461
<Position9>
463462
<Filename Value="MainUnit.pas"/>
464-
<Caret Line="4945" Column="62" TopLine="4915"/>
463+
<Caret Line="5042" Column="49" TopLine="5002"/>
465464
</Position9>
466465
<Position10>
467466
<Filename Value="MainUnit.pas"/>
468-
<Caret Line="4966" Column="29" TopLine="4941"/>
467+
<Caret Line="5227" Column="17" TopLine="5195"/>
469468
</Position10>
470469
<Position11>
471470
<Filename Value="MainUnit.pas"/>
472-
<Caret Line="4967" Column="29" TopLine="4941"/>
471+
<Caret Line="5250" Column="20" TopLine="5210"/>
473472
</Position11>
474473
<Position12>
475474
<Filename Value="MainUnit.pas"/>
476-
<Caret Line="4966" Column="60" TopLine="4953"/>
475+
<Caret Line="6196" Column="44" TopLine="6156"/>
477476
</Position12>
478477
<Position13>
479478
<Filename Value="MainUnit.pas"/>
480-
<Caret Line="4943" Column="23" TopLine="4919"/>
479+
<Caret Line="7081" Column="35" TopLine="7042"/>
481480
</Position13>
482481
<Position14>
483482
<Filename Value="MainUnit.pas"/>
484-
<Caret Line="4966" Column="60" TopLine="4925"/>
483+
<Caret Line="7083" Column="39" TopLine="7042"/>
485484
</Position14>
486485
<Position15>
487486
<Filename Value="MainUnit.pas"/>
488-
<Caret Line="4968" Column="57" TopLine="4960"/>
487+
<Caret Line="7086" Column="30" TopLine="7045"/>
489488
</Position15>
490489
<Position16>
491490
<Filename Value="MainUnit.pas"/>
492-
<Caret Line="3118" Column="7" TopLine="3108"/>
491+
<Caret Line="376" Column="14" TopLine="365"/>
493492
</Position16>
494493
<Position17>
495-
<Filename Value="MainUnit.pas"/>
496-
<Caret Line="442" Column="19" TopLine="420"/>
494+
<Filename Value="DiscImage_ADFS.pas"/>
495+
<Caret Line="1653" Column="50" TopLine="1634"/>
497496
</Position17>
498497
<Position18>
499-
<Filename Value="MainUnit.pas"/>
500-
<Caret Line="1682" Column="44" TopLine="1641"/>
498+
<Filename Value="DiscImage.pas"/>
499+
<Caret Line="459" Column="20" TopLine="427"/>
501500
</Position18>
502501
<Position19>
503502
<Filename Value="MainUnit.pas"/>
504-
<Caret Line="3118" Column="16" TopLine="3078"/>
503+
<Caret Line="3451" Column="70" TopLine="3432"/>
505504
</Position19>
506505
<Position20>
507506
<Filename Value="MainUnit.pas"/>
508-
<Caret Line="3119" Column="44" TopLine="3079"/>
507+
<Caret Line="395" Column="80" TopLine="394"/>
509508
</Position20>
510509
<Position21>
511510
<Filename Value="MainUnit.pas"/>
512-
<Caret Line="3323" Column="47" TopLine="3282"/>
511+
<Caret Line="3597" Column="27" TopLine="3569"/>
513512
</Position21>
514513
<Position22>
515514
<Filename Value="MainUnit.pas"/>
516-
<Caret Line="4358" Column="23" TopLine="4318"/>
515+
<Caret Line="3737" Column="21" TopLine="3715"/>
517516
</Position22>
518517
<Position23>
519518
<Filename Value="MainUnit.pas"/>
520-
<Caret Line="4362" Column="20" TopLine="4322"/>
519+
<Caret Line="376" Column="15" TopLine="371"/>
521520
</Position23>
522521
<Position24>
523522
<Filename Value="MainUnit.pas"/>
524-
<Caret Line="4366" Column="20" TopLine="4326"/>
523+
<Caret Line="4720" Column="58" TopLine="4712"/>
525524
</Position24>
526525
<Position25>
527-
<Filename Value="MainUnit.pas"/>
528-
<Caret Line="5114" Column="43" TopLine="4425"/>
526+
<Filename Value="DiscImage_ADFS.pas"/>
527+
<Caret Line="2273" Column="65" TopLine="2233"/>
529528
</Position25>
530529
<Position26>
531-
<Filename Value="../GJHCustomConponents/GJHCustomComponents.pas"/>
532-
<Caret Line="1616" Column="9" TopLine="1234"/>
530+
<Filename Value="DiscImage.pas"/>
531+
<Caret Line="802" Column="16" TopLine="785"/>
533532
</Position26>
534533
<Position27>
535-
<Filename Value="MainUnit_Console.pas"/>
536-
<Caret Line="429" Column="29" TopLine="416"/>
534+
<Filename Value="DiscImage_Published.pas"/>
535+
<Caret Line="36" Column="2"/>
537536
</Position27>
538537
<Position28>
539-
<Filename Value="MainUnit_Console.pas"/>
540-
<Caret Line="408" Column="48" TopLine="384"/>
538+
<Filename Value="DiscImage.pas"/>
539+
<Caret Line="802" Column="15" TopLine="778"/>
541540
</Position28>
542541
<Position29>
543-
<Filename Value="DiscImage.pas"/>
544-
<Caret Line="819" Column="17" TopLine="812"/>
542+
<Filename Value="MainUnit.pas"/>
543+
<Caret Line="4720" Column="58" TopLine="4697"/>
545544
</Position29>
546545
<Position30>
547-
<Filename Value="DiscImage_Published.pas"/>
548-
<Caret Line="894" Column="2" TopLine="862"/>
546+
<Filename Value="MainUnit.pas"/>
547+
<Caret Line="394" Column="13" TopLine="359"/>
549548
</Position30>
550549
</JumpHistory>
551550
<RunParams>
@@ -564,11 +563,15 @@
564563
<Debugging>
565564
<Watches>
566565
<Item>
567-
<Expression Value="allocSize"/>
566+
<Expression Value="freeptr"/>
567+
<DisplayStyle Value="wdfHex"/>
568+
</Item>
569+
<Item>
570+
<Expression Value="ptr"/>
568571
<DisplayStyle Value="wdfHex"/>
569572
</Item>
570573
<Item>
571-
<Expression Value="TmpVal1"/>
574+
<Expression Value="safilelen"/>
572575
<DisplayStyle Value="wdfHex"/>
573576
</Item>
574577
</Watches>

LazarusSource/DiscImage_ADFS.pas

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,10 +2263,15 @@ function TDiscImage.ADFSFindFreeSpace(filelen: Cardinal;
22632263
if not FMap then //Old map
22642264
begin
22652265
ptr:=ReadByte($1FE); //Number of free space entries
2266+
//Find a space equal to the size of the file
22662267
freeptr:=0;
2267-
while(freeptr<ptr)
2268-
and(Read24b($100+freeptr)*$100<safilelen)do
2269-
inc(freeptr,3);
2268+
while(freeptr<ptr)and(Read24b($100+freeptr)*$100<>safilelen)do inc(freeptr,3);
2269+
//If this fails, find a space bigger than the size of the file
2270+
if freeptr>=ptr then
2271+
begin
2272+
freeptr:=0;
2273+
while(freeptr<ptr)and(Read24b($100+freeptr)*$100<safilelen)do inc(freeptr,3);
2274+
end;
22702275
if freeptr<ptr then //Space found
22712276
begin
22722277
//Fill in the details

0 commit comments

Comments
 (0)