Re: [hatari-devel] Drive image byteswap confusion |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Drive image byteswap confusion
- From: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Fri, 18 Oct 2019 21:11:40 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1571425900; s=strato-dkim-0002; d=seimet.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Bqme94/2BBe6WEOk/QnmRBJvGqSBjqkw7Af7fsn2Ae4=; b=VGQ6a7xqfWWeHgpvJ6YYi493OKZqC0g9jlTCKordU76t7utweawGT9QmcVJNNXKK6Q na55q7eqpxyKgcY8cvLTcNZrPCnL0sT97HIKjLXDykJGCQCt9vooX4eOXbdyybWx6PMG aj2ChS97v7SFnhefyH6RN90mMpzMbbmgCfLNHhFOU9ILr36HCpF2IWlYJXB53xkAwY+b voCIhThWqGDRmJTh0ZnJq8UMbxgaG0YCqdC2M8USQVkFIJ67Jcrq5rCi2uatRZTIyG5b s7c5HMljwhdNoQv17i5QZF33eZmTCcfua+kZqD3zFsAgsbu23PVOrxSkg6p9EixbsSWq BMZw==
This looks wrong to me. When byteswapping is configured to be off, it's
actually enabled and Hatari reports:
IDE: little->big endian byte-swapping enabled for drive 0.
This explains why an image, which was created when assigned to an IDE
drive with byte swapping off (which I'd expect to be the default IDE
behavior of a real Atari) is bootable out of the box when assigned to
an ACSI drive. With a real Atari this would not work.
> Hi,
>
> On 10/18/19 8:02 PM, Uwe Seimet wrote:
> > I'm confused about how Hatari handles byteswapping. Can it be that if
> > Byteswap is "Off" it is *not* compatible with the standard behavior of an
> > Atari IDE port, and it has to be "On" in order to be compatible?
>
> I see in ide.c:
> nIDEPartitions += HDC_PartitionCount(hd_table[i]->fhndl, TRACE_IDE,
> &is_byteswap);
> /* Our IDE implementation is little endian by default,
> * so we need to byteswap if the image is not swapped! */
> if (ConfigureParams.Ide[i].nByteSwap == BYTESWAP_AUTO)
> hd_table[i]->byteswap = !is_byteswap;
> else
> hd_table[i]->byteswap = !ConfigureParams.Ide[i].nByteSwap;
> LOG_TRACE(TRACE_IDE, "IDE: little->big endian byte-swapping %s for
> drive %d\n",
> hd_table[i]->byteswap ? "enabled" : "disabled", i);
>
>
> - Eero
>
>