Re: [hatari-devel] Dynamic Bus Sizing and I/O Register Access |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Dynamic Bus Sizing and I/O Register Access
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Fri, 12 Jan 2024 18:41:24 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1705084886; bh=w4/PhzZA1WI3e+7IfISkyoHxWQ1i0exHAEKJzVd9RmI=; h=Date:From:To:Subject:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=Six2OJ+9r/syYx8r77WeEzBA6196jn5i6zRqG8j72nBe0LFJ+I/wxs3KeXuQOgzVN Pvqe707rkBau98ZRPOA9UnRhI9cAqB32qzmmqRW2xmqdRPJSqaB+0QtQaExvE5pfIQ 3Qrmg1Kp4sl5WEgzENEJjMPWHhd0zsor9MBuF11fGtUoFhghwqoQ3dNRi9P7b9qQlW KWW2mWoWbrLxs0D6eEk48DYUYcgN+aZY+Np5pGNXEoEAg5BQFH503vU9JwF11aPbRs w4U5RxFDYdPF/sGDwajaE8bjk4bylRp/hvpMpJ8s4PWiV/TE6cR8kJ62HI7ppns0kn PsGJyOPkWmzeg==
Am Wed, 10 Jan 2024 23:53:43 +0200
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
> Hi,
>
> On 9.1.2024 21.07, Andreas Grabher wrote:
> > I have a question regarding register access via ioMem.c:
> >
> > Does this code respect 68020 and 68030 dynamic bus sizing?
> >
> > I have a problem with Previous that seems to be impossible to solve with the given code. There is a byte wide register on the board that is accessed in two ways on the 68030. The bootloader uses long (32 bit) access and the OS uses byte (8 bit) access to read or write this register. While this obviously works on real hardware it fails on Previous. I can either make it work with byte or with long access but not both. I suspect that dynamic bus sizing is not yet emulated. Or am I using the code in the wrong way?
> >
> > This is the entry in the memory table:
> > { 0x02010000, SIZE_BYTE, Brightness_Read, Brightness_Write },
> >
> > And this is one of the handler functions:
> > void Brightness_Write(void) {
> > bright_reg = IoMem[IoAccessCurrentAddress & IO_SEG_MASK];
> > Log_Printf(LOG_DEBUG,"[Brightness] Write at $%08x val=$%02x PC=$%08x\n", IoAccessCurrentAddress, IoMem[IoAccessCurrentAddress & IO_SEG_MASK], m68k_getpc());
> > if (bright_reg&BRIGHTNESS_UNBLANK) {
> > Log_Printf(LOG_WARN,"[Brightness] Setting brightness to %02x\n", bright_reg&BRIGHTNESS_MASK);
> > }
> > }
> >
> > This works with the OS (byte access) but not with the bootloader (long access). Any thoughts on this?
>
> This is really Nicolas' area, but AFAIK there are registers on Atari
> that behave differently depending on how they're accessed, and Hatari
> has several register handler functions that take that into account.
>
> For examples, see:
> git grep nIoMemAccessSize
Yes, right. This basically depends on what your I/O hardware (like the
"glue" on the ST) is doing with the accesses on the bus.
Do you know what's supposed to happen if the bootloader write a 32-bit word
to 0x02010000 ? For example, if it wrote 0x12345678 to that address, which
byte is supposed to end up in the brightness register?
Thomas