Compare commits
14 Commits
83d3052877
...
c9540e3524
Author | SHA1 | Date |
---|---|---|
michaelangel007 | c9540e3524 | |
michaelangel007 | eb4a94c1ad | |
michaelangel007 | 9cd97ba55d | |
michaelangel007 | c3771eed99 | |
michaelangel007 | 5ec0c84a73 | |
michaelangel007 | 528c6e9998 | |
michaelangel007 | a29a8b0215 | |
michaelangel007 | 05c790532f | |
michaelangel007 | 7395ff335c | |
michaelangel007 | 973c2e0d2f | |
michaelangel007 | ac9487c04f | |
michaelangel007 | 44522562ba | |
michaelangel007 | d76a6175ab | |
michaelangel007 | 24825f9dc2 |
|
@ -0,0 +1,15 @@
|
||||||
|
echo.>foo1.txt
|
||||||
|
echo.>foo2.txt
|
||||||
|
echo.>foo3.txt
|
||||||
|
|
||||||
|
REM Windows
|
||||||
|
echo a020a90220a8fc8d30c0a92420a8fc8d30c088d0ed60 > softbeep.hex
|
||||||
|
certutil.exe -f -v -decodehex softbeep.hex softbeep.bin
|
||||||
|
REM Windows
|
||||||
|
|
||||||
|
prodosfs test.dsk init -size=140 /TEST
|
||||||
|
prodosfs test.dsk cp foo1.txt /
|
||||||
|
prodosfs test.dsk cp foo2.txt /
|
||||||
|
prodosfs test.dsk cp foo3.txt /
|
||||||
|
prodosfs test.dsk cp -aux=$0300 softbeep.bin /
|
||||||
|
prodosfs test.dsk catalog
|
|
@ -24,6 +24,7 @@
|
||||||
<ProjectGuid>{8c7d2412-52c5-4c68-9e93-5718cd84f857}</ProjectGuid>
|
<ProjectGuid>{8c7d2412-52c5-4c68-9e93-5718cd84f857}</ProjectGuid>
|
||||||
<RootNamespace>prodos</RootNamespace>
|
<RootNamespace>prodos</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
<ProjectName>prodosfs</ProjectName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
@ -141,7 +142,34 @@
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\generic.disk.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\prodos.cpp" />
|
<ClCompile Include="..\prodos.cpp" />
|
||||||
|
<ClCompile Include="..\prodos.tools.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\prodos.utils.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\string.utils.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\itoa.comma.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|
118
README.md
118
README.md
|
@ -1,5 +1,7 @@
|
||||||
# Apple 2 ProDOS (Virtual Disk) Utilities
|
# Apple 2 ProDOS (Virtual Disk) Utilities
|
||||||
|
|
||||||
|
`ProdosFS` is a command-line utility to create and manipulate virtual ProDOS volume images for emulators.
|
||||||
|
|
||||||
**NOTE:** This is still a work-in-progress.
|
**NOTE:** This is still a work-in-progress.
|
||||||
|
|
||||||
Commands that work:
|
Commands that work:
|
||||||
|
@ -21,14 +23,14 @@ Usage: <dsk> <command> [<options>] [<path>]
|
||||||
|
|
||||||
cat Catalog (short form)
|
cat Catalog (short form)
|
||||||
[<path>] Path of virtual sub-directory to view
|
[<path>] Path of virtual sub-directory to view
|
||||||
Defaults to: /
|
NOTE: Defaults to: /
|
||||||
catalog Catalog (long form)
|
catalog Catalog (long form)
|
||||||
[<path>] Path of virtual sub-directory to view
|
[<path>] Path of virtual sub-directory to view
|
||||||
Defaults to: /
|
NOTE: Defaults to: /
|
||||||
cp Add file(s) to volume
|
cp Add file(s) to volume File type will auto-detected based on filename extension.
|
||||||
<path> Destination virutal sub-directory to add to
|
i.e. BAS, BIN, FNT, TXT,SYS, etc.
|
||||||
There is no default -- it must be specified
|
|
||||||
-access=$## Set access flags
|
-access=$## Set access flags
|
||||||
|
NOTE: Defaults to $C3
|
||||||
$80 Volume/file can be destroyed
|
$80 Volume/file can be destroyed
|
||||||
$40 Volume/file can be renamed
|
$40 Volume/file can be renamed
|
||||||
$20 Volume/file changed since last backup
|
$20 Volume/file changed since last backup
|
||||||
|
@ -47,6 +49,9 @@ Usage: <dsk> <command> [<options>] [<path>]
|
||||||
-type=$## Force file type to one of the 256 types
|
-type=$## Force file type to one of the 256 types
|
||||||
-moddate=MM/DD/YY Set last modified date to specified date
|
-moddate=MM/DD/YY Set last modified date to specified date
|
||||||
-modtime=HH:MM Set last modified date to specified time
|
-modtime=HH:MM Set last modified date to specified time
|
||||||
|
<path> Destination virutal sub-directory to add to
|
||||||
|
There is no default -- it must be specified
|
||||||
|
NOTE: Options must come first
|
||||||
dir Catalog (long form)
|
dir Catalog (long form)
|
||||||
This is an alias for 'catalog'
|
This is an alias for 'catalog'
|
||||||
get Extract file from volume
|
get Extract file from volume
|
||||||
|
@ -56,10 +61,11 @@ Usage: <dsk> <command> [<options>] [<path>]
|
||||||
To delete a file see ........: rm
|
To delete a file see ........: rm
|
||||||
To delete a sub-directory see: rmdir
|
To delete a sub-directory see: rmdir
|
||||||
init Format disk
|
init Format disk
|
||||||
<path> Name of virtual volume.
|
|
||||||
-size=140 Format 140 KB (5 1/4")
|
-size=140 Format 140 KB (5 1/4")
|
||||||
-size=800 Format 800 KB (3 1/2")
|
-size=800 Format 800 KB (3 1/2")
|
||||||
-size=32 Format 32 MB (Hard Disk)
|
-size=32 Format 32 MB (Hard Disk)
|
||||||
|
<path> Name of virtual volume. You MUST specify this.
|
||||||
|
NOTE: Options must come first
|
||||||
ls Catalog (file names only)
|
ls Catalog (file names only)
|
||||||
[<path>] Path to sub-directory to view
|
[<path>] Path to sub-directory to view
|
||||||
Defaults to: /
|
Defaults to: /
|
||||||
|
@ -92,44 +98,92 @@ e.g.
|
||||||
|
|
||||||
Three different disk sizes are accepted for init
|
Three different disk sizes are accepted for init
|
||||||
|
|
||||||
prodos test.dsk init -size=140 # 5 1/4" (140 KB)
|
prodosfs test.dsk init -size=140 /TEST514 # 5 1/4" (140 KB)
|
||||||
prodos test.dsk init -size=800 # 3 1/2" (800 KB)
|
prodosfs test.dsk init -size=800 /TEST312 # 3 1/2" (800 KB)
|
||||||
prodos test.dsk init -size=32 #HardDisk ( 32 MB)
|
prodosfs test.dsk init -size=32 /TEST32M #HardDisk ( 32 MB)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
prodos test.dsk ls
|
prodosfs test.dsk init /TEST
|
||||||
prodos test.dsk cat
|
prodosfs test.dsk ls
|
||||||
prodos test.dsk cp foo1 foo2 /
|
prodosfs test.dsk cat
|
||||||
prodos test.dsk mkdir bar
|
prodosfs test.dsk cp foo1 foo2 /
|
||||||
prodos test.dsk cp foo2 /bar
|
prodosfs test.dsk mkdir bar
|
||||||
prodos test.dsk get /bar/foo2
|
prodosfs test.dsk cp foo2 /bar
|
||||||
prodos test.dsk rm /bar/foo2
|
prodosfs test.dsk get /bar/foo2
|
||||||
prodos test.dsk rmdir /bar
|
prodosfs test.dsk rm /bar/foo2
|
||||||
prodos test.dsk init /TEST
|
prodosfs test.dsk rmdir /bar
|
||||||
prodos b140.dsk init -size=140 /BLANK140
|
|
||||||
prodos b800.dsk init -size=800 /BLANK800
|
prodosfs b140.dsk init -size=140 /BLANK140
|
||||||
prodos b032.dsk init -size=32 /BLANK32
|
prodosfs b800.dsk init -size=800 /BLANK800
|
||||||
|
prodosfs b032.dsk init -size=32 /BLANK32
|
||||||
```
|
```
|
||||||
|
|
||||||
Example output:
|
Given these steps ...
|
||||||
|
|
||||||
```
|
```
|
||||||
dnb??iwr /TEST Blocks Size Type Aux Kind iNode Dir Ver Min Create Time Modified Time
|
echo. > foo1.txt
|
||||||
-------- ---------------- ------ ------- ------- ----- ----- ----- ----- --- --- --------- ------ --------- ------
|
echo. > foo2.txt
|
||||||
-------- *FOO1.TXT 1 $000002 TXT $04 $0000 sed 1 @0007 @0002 0.0 v00 6-NOV-17 <NO DATE>
|
echo. > foo3.txt
|
||||||
-------- *FOO2.TXT 1 $000002 TXT $04 $0000 sed 1 @0008 @0002 0.0 v00 6-NOV-17 <NO DATE>
|
|
||||||
-------- *FOO3.TXT 1 $000002 TXT $04 $0000 sed 1 @0009 @0002 0.0 v00 6-NOV-17 <NO DATE>
|
REM Windows
|
||||||
-------- *TEXT.BIN 3 $000264 BIN $06 $0000 sap 2 @000A @0002 0.0 v00 6-NOV-17 <NO DATE>
|
echo a020a90220a8fc8d30c0a92420a8fc8d30c088d0ed60 > softbeep.hex
|
||||||
========
|
certutil.exe -f -v -decodehex softbeep.hex softbeep.bin
|
||||||
|
REM Windows
|
||||||
|
|
||||||
|
prodosfs test.dsk init -size=140 /TEST
|
||||||
|
prodosfs test.dsk cp foo1.txt /
|
||||||
|
prodosfs test.dsk cp foo2.txt /
|
||||||
|
prodosfs test.dsk cp foo3.txt /
|
||||||
|
prodosfs test.dsk cp -aux=$0300 softbeep.bin /
|
||||||
|
prodosfs test.dsk catalog
|
||||||
|
```
|
||||||
|
|
||||||
|
... it will produce this output:
|
||||||
|
|
||||||
|
```
|
||||||
|
Acc dnb??iwr /TEST Blocks Size Type Aux Kind iNode Dir Ver Min Create Time Modified Time
|
||||||
|
--- -------- ---------------- ------ ------- ------- ----- ----- ----- ----- --- --- --------- ------ --------- ------
|
||||||
|
$C3 dn----wr FOO1.TXT 1 $000002 TXT $04 $0000 sed 1 @0007 @0002 0.0 v00 6-APR-23 <NO DATE>
|
||||||
|
$C3 dn----wr FOO2.TXT 1 $000002 TXT $04 $0000 sed 1 @0008 @0002 0.0 v00 6-APR-23 <NO DATE>
|
||||||
|
$C3 dn----wr FOO3.TXT 1 $000002 TXT $04 $0000 sed 1 @0009 @0002 0.0 v00 6-APR-23 <NO DATE>
|
||||||
|
$C3 dn----wr SOFTBEEP.BIN 1 $000016 BIN $06 $0300 sed 1 @000A @0002 0.0 v00 6-APR-23 <NO DATE>
|
||||||
|
===============
|
||||||
Files: 4 / 52 ( 7.69%)
|
Files: 4 / 52 ( 7.69%)
|
||||||
Blocks:
|
Blocks:
|
||||||
Free: 267 (95.36%), 1st: @ $000D = 13
|
Free: 269 (96.07%), 1st: @ $000B = 11
|
||||||
Used: 13 ( 4.64%)
|
Used: 11 ( 3.93%)
|
||||||
Total: 280
|
Total: 280
|
||||||
```
|
```
|
||||||
|
|
||||||
# Building / Compiling
|
# Building / Compiling
|
||||||
|
|
||||||
|
* MacOS
|
||||||
|
|
||||||
`make clean; make`
|
`make clean; make`
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
|
||||||
|
Start Microsoft Visual Studio 2019 and open `MSVC2019\prodos.sln`.
|
||||||
|
|
||||||
|
# Soft Beep
|
||||||
|
|
||||||
|
```as
|
||||||
|
|
||||||
|
ORG $300
|
||||||
|
SoftBeep LDY #$20
|
||||||
|
SoftCycle LDA #$02 ;+
|
||||||
|
JSR Wait
|
||||||
|
STA Squeeker
|
||||||
|
LDA #$24
|
||||||
|
JSR Wait
|
||||||
|
STA Squeeker
|
||||||
|
DEY
|
||||||
|
BNE SoftCycle ;^ $0904
|
||||||
|
```
|
||||||
|
|
||||||
|
Converted to ASCII hex dump
|
||||||
|
|
||||||
|
```
|
||||||
|
certutil -encodehex -f softbeep softbeep.hex 12
|
||||||
|
```
|
||||||
|
|
17
prodos.cpp
17
prodos.cpp
|
@ -85,9 +85,10 @@ Is this still needed?
|
||||||
" [<path>] Path of virtual sub-directory to view\n"
|
" [<path>] Path of virtual sub-directory to view\n"
|
||||||
" Defaults to: /\n"
|
" Defaults to: /\n"
|
||||||
,// FILE_ADD
|
,// FILE_ADD
|
||||||
" <path> Destination virutal sub-directory to add to\n"
|
" File type will auto-detected based on filename extension.\n"
|
||||||
" There is no default -- it must be specified\n"
|
" i.e. BAS, BIN, FNT, TXT,SYS, etc.\n"
|
||||||
" -access=$## Set access flags\n"
|
" -access=$## Set access flags\n"
|
||||||
|
" NOTE: Defaults to $C3"
|
||||||
" $80 Volume/file can be destroyed\n"
|
" $80 Volume/file can be destroyed\n"
|
||||||
" $40 Volume/file can be renamed\n"
|
" $40 Volume/file can be renamed\n"
|
||||||
" $20 Volume/file changed since last backup\n"
|
" $20 Volume/file changed since last backup\n"
|
||||||
|
@ -109,6 +110,9 @@ Is this still needed?
|
||||||
" The file type is auto-detected via extension\n"
|
" The file type is auto-detected via extension\n"
|
||||||
" -moddate=MM/DD/YY Set last modified date to specified date\n"
|
" -moddate=MM/DD/YY Set last modified date to specified date\n"
|
||||||
" -modtime=HH:MM Set last modified date to specified time\n"
|
" -modtime=HH:MM Set last modified date to specified time\n"
|
||||||
|
" <path> Destination virutal sub-directory to add to\n"
|
||||||
|
" There is no default -- it must be specified\n"
|
||||||
|
" NOTE: Options must come first\n"
|
||||||
, //CAT_LONG2
|
, //CAT_LONG2
|
||||||
" This is an alias for 'catalog'\n"
|
" This is an alias for 'catalog'\n"
|
||||||
,// FILE_GET
|
,// FILE_GET
|
||||||
|
@ -187,9 +191,9 @@ int usage()
|
||||||
"\n"
|
"\n"
|
||||||
"Three different disk sizes are accepted for init\n"
|
"Three different disk sizes are accepted for init\n"
|
||||||
"\n"
|
"\n"
|
||||||
" prodosfs test.dsk init -size=140 # 5 1/4\" (140 KB)\n"
|
" prodosfs test.dsk init -size=140 /TEST514 # 5 1/4\" (140 KB)\n"
|
||||||
" prodosfs test.dsk init -size=800 # 3 1/2\" (800 KB)\n"
|
" prodosfs test.dsk init -size=800 /TEST312 # 3 1/2\" (800 KB)\n"
|
||||||
" prodosfs test.dsk init -size=32 #HardDisk ( 32 MB)\n"
|
" prodosfs test.dsk init -size=32 /TEST32M #HardDisk ( 32 MB)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -500,6 +504,7 @@ bool doCopy( ProDOS_FileHeader_t *entry, const char *filename )
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG_MAIN
|
#if DEBUG_MAIN
|
||||||
|
printf( "File Access: $%02X\n", gEntry.access );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool bStatus = ProDOS_FileAdd( gpPath, pSrcFileName, &gEntry );
|
bool bStatus = ProDOS_FileAdd( gpPath, pSrcFileName, &gEntry );
|
||||||
|
@ -803,7 +808,7 @@ int main( const int nArg, const char *aArg[] )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if( nArg < 2 )
|
if( (nArg < 2) || !pCommand )
|
||||||
return usage();
|
return usage();
|
||||||
else
|
else
|
||||||
return printf( "ERROR: Unknown command: %s\n", pCommand );
|
return printf( "ERROR: Unknown command: %s\n", pCommand );
|
||||||
|
|
|
@ -279,6 +279,14 @@ if( block == PRODOS_ROOT_BLOCK )
|
||||||
void prodos_InitFileHeader( ProDOS_FileHeader_t *entry )
|
void prodos_InitFileHeader( ProDOS_FileHeader_t *entry )
|
||||||
{
|
{
|
||||||
memset( entry, 0, sizeof( ProDOS_FileHeader_t ) );
|
memset( entry, 0, sizeof( ProDOS_FileHeader_t ) );
|
||||||
|
|
||||||
|
// Default ot Read/Write/Rename/Destroy
|
||||||
|
entry->access = 0
|
||||||
|
| ACCESS_D
|
||||||
|
| ACCESS_N
|
||||||
|
| ACCESS_W
|
||||||
|
| ACCESS_R
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Globals ________________________________________________________________
|
// Globals ________________________________________________________________
|
||||||
|
|
Loading…
Reference in New Issue