Code Monkey home page Code Monkey logo

dsk2po's Introduction

dsk2po and po2dsk

Python scripts to convert Apple II/III .DSK (DO) images to ProDOS-ordered images and vice versa.

This is nothing very exciting, it just maps sectors in .dsk (DOS-order, .do) files into those of a .po (ProDOS-order) file. Most Apple II emulators can handle both, but certain utilities (with which I wanted to use existing .dsk images) assume ProDOS-ordered files.

Usage is just (assuming you've done chmod 755 dsk2po.py, else precede with python command):

./dsk2po.py image.dsk

This will create image.dsk.po alongside it. Pretty much no checking is done. It just goes through all the tracks and converts them, then ends.

Both scripts will handle an arbitrary number of tracks, but will print a warning if the number of tracks is not 35.

This can be used as an action for find, like so:

find imagefolders/\*/\*.dsk -exec ./dsk2po.py {} \;

...which was mostly the point.

You can also go the opposite direction:

./po2dsk.py image.po

dsk2po's People

Contributors

ct6502 avatar digarok avatar paulhagstrom avatar ryu10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dsk2po's Issues

SyntaxWarning: invalid escape sequence '\.'

Both po2dsk and dsk2po has invalid escape sequences:

$ ./po2dsk.py test.po 
/home/nerun/Downloads/./po2dsk.py:34: SyntaxWarning: invalid escape sequence '\.'
  dskfilename = re.sub('\.po$', '', filenameIn, flags=re.IGNORECASE) + ".dsk"
/home/nerun/Downloads/dsk2po.py:31: SyntaxWarning: invalid escape sequence '\.'
  pofilename = re.sub('\.dsk$', '', dskfilename, flags=re.IGNORECASE) + ".po"
po2dsk - convert po files to dsk files
Writing dsk image to test.dsk

Easy to fix:

  • po2dsk, line 34: change \.po$ to \\.po$
  • dsk2po, line 31: change \.dsk$ to \\.dsk$

I am running Python version 3.12.4.

Converted disks crash on boot

I have various .dsk and .do images that boot fine on AppleWin.
I have a BOOTI that requires prodos order images, so I tried various images that I have with commands like:

python dsk2po.py mydisk.do -> which seemed to succeed and produced mydisk.do.po

When I try to boot these on the booti it crashes out at a machine language prompt.

When I boot the same images on AppleWin, they work.

Your tool was specifically linked to from the booti site. Do you have any idea what is going on?

I'm (trying) to convert Dos 3.3 images (dsk/do) to prodos order so I can run them on the booti. I've tried converting plain vanilla things like the System master disk that comes with the Apple ][.

Not converting disk images created with CiderPress or AppleCommander

Running Python 3.12.4.

  1. Create a ProDOS disk with CiderPress 4.1.1 or AppleCommander 1.9.0
  2. Execute: ./po2dsk.py test.po
  3. Check in Linux with command "file":
$ file test*                         
test.dsk: Apple ProDOS Image, Volume /NEW.DISK, 280 Blocks
test.po:  Apple ProDOS Image, Volume /NEW.DISK, 280 Blocks

Both files are still ProDOS, but they are different:

$ sha1sum test*
aa6797610379f37f66c34680429802dc50e1bc40  test.dsk
3b03054b88b2d4b7bde1db247476e6511c605798  test.po

Addendum

I decided to test with CiderPress 2 command line utility for Linux to list content and check both files:

$ ./cp2 v test.po   
File: test.po
Disk image (Unadorned, order=pdos/blk) - 140KB ProDOS "NEWDISK", 273 blocks free
Type Auxtyp Modified          Length  Storage *Name                             
---- ------ --------------- -------- -------- ----------------------------------

$ ./cp2 v test.dsk
File: test.dsk
Disk image (Unadorned, order=dos/sect) - 140KB ProDOS "NEWDISK", 273 blocks free
Type Auxtyp Modified          Length  Storage *Name                             
---- ------ --------------- -------- -------- ----------------------------------

We can see here that conversion is PARTIAL. Disk is now order=dos/sect, but it's still ProDOS "NEWDISK", 273 blocks free as you can see.

Here a test in a DOS ordered disk:

$ ./cp2/cp2 v test.dsk           
File: test.dsk
Disk image (Unadorned, order=dos/sect) - 140KB DOS 3.3 Vol 254, 528 sectors free
Type Auxtyp Modified          Length  Storage *Name                             
---- ------ --------------- -------- -------- ----------------------------------

Info after 140KB is different: DOS 3.3 Vol 254, 528 sectors free.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.