I'm checking the formulas used to process the VRAM address from the CPU (0x00000-0x20000 max (when using 0xA0000-0xBFFFF)) to planar addresses (plane 0-3 offset 0x0000-0xFFFF). Anyone knows if this is OK?
realoffset is the memory address relative to the start of the CPU window (0xA0000, 0xB0000 or 0xB8000).
At the end of this routine, the plane variable must contain the plane (0-3) and the offset (0x0000-0x(1)(FFFF,8000 or 0000), depending on the window) must be in realoffset.