[hatari-devel] Dynamic Bus Sizing and I/O Register Access

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


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


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/