💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › unix › mapper.c captured on 2024-06-16 at 14:28:53.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Path: news1.icaen!news.uiowa.edu!news1.chicago.iagnet.net!iagnet.net!howland.erols.net!usc!newshub.csu.net!not-for-mail
From: luvisi@andru.sonoma.edu
Newsgroups: comp.emulators.apple2
Subject: Re: Converting .po to .dsk under UNIX
Date: 04 Dec 1997 09:39:14 -0800
Organization: CSUnet
Lines: 59
Message-ID: <m2en3txb25.fsf@andru.sonoma.edu>
References: <66537i$s5o@bertrand.ccs.carleton.ca>
NNTP-Posting-Host: andru.sonoma.edu
X-Trace: nuke.csu.net 881257716 21997 (None) 130.157.3.226
X-Complaints-To: abuse@csu.net
X-Newsreader: Gnus v5.3/Emacs 19.34

Simon Hall <shall@rideau.carleton.ca> writes:
> Any-one have a way to convert .po file to .dsk images that will run
> under UNIX.
> I have a few file's I would like to convert .

I use a program called mapper which I think I got out of the incoming
directory in asimov before it was closed from downloads :-(

it's short enough I'll just include it here.

andru

#include	<stdio.h>

#ifdef __BORLANDC__
#include <fcntl.h>
#endif

/*
 *  Map a disk image in Prodos block ordering to DOS 3.3 block ordering
 *	usage:  mapper < old_image > new_image
 */

main() {
unsigned char buf[4096];
int track;

#ifdef __BORLANDC__
        setmode( (stdin->fd), O_BINARY );
        setmode( (stdout->fd), O_BINARY );
#endif

	for (track = 0; track < 35; track++) {
		if (read(0, buf, 4096) != 4096) {
			perror("bad read");
			exit(1);
		}

		write(1, buf, 256);
		write(1, &buf[0xE00], 256);
		write(1, &buf[0xD00], 256);
		write(1, &buf[0xC00], 256);
		write(1, &buf[0xB00], 256);
		write(1, &buf[0xA00], 256);
		write(1, &buf[0x900], 256);
		write(1, &buf[0x800], 256);
		write(1, &buf[0x700], 256);
		write(1, &buf[0x600], 256);
		write(1, &buf[0x500], 256);
		write(1, &buf[0x400], 256);
		write(1, &buf[0x300], 256);
		write(1, &buf[0x200], 256);
		write(1, &buf[0x100], 256);
		write(1, &buf[0xF00], 256);
	}
}