[hatari-devel] Dynamic Bus Sizing and I/O Register Access |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: Hatari devel list <hatari-devel@xxxxxxxxxxxxxxxxxxx>
- Subject: [hatari-devel] Dynamic Bus Sizing and I/O Register Access
- From: Andreas Grabher <andreas_g86@xxxxxxxxxx>
- Date: Tue, 9 Jan 2024 20:07:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1704827240; bh=MEXrGW2vgsWGAHicnqwqqdz9HbDgox/V32pKtj2Nqss=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=IHMFwz6dUsNPXO6fKwqNgiIoTociClGCnn6x/d3O3y+XsGbo0MVCrZDVzj2OTpvhq AVtOQ7ZfQ8FQ5P++n6/I+5GkCw+ERKGjHFeB/vQYhoybr1jICjZ7TCC7f6MuQNVrKA 3bTBKpyV26rLjZWBOyyjcgI9NbljAwnha+CT4AG6urJgWypB9mODrXR2qq2QKfrFXV T+Pa2eHxd3lIjHD4UIvdbvP2Fq5Ulnv0VJHs5oy+46inJzE5LaNKo8NpnrVEPmoQyz HktdkeUYwlZPeXERZBmQVcOQZ6PtyOfzh2qHc3tDWS4xzSK0xzFM243a1tTvDjP1Nh 8ezKRUvDrqPiQ==
Hello all,
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?
Regards,
Andreas