May I suggest another patch?
The appended patch removes some constants that are kind of duplicate. It
also makes readout of access_to_ext_memory a bit more safe (in case
someone changes to values of the constants).
Furthermore it cleans access_to_ext_memory handling a bit. This might be
slightly slower (1 << variable instead of 1 << constant) but saves
quite some code. On the other hand it replaces "address +=
DSP_RAMSIZE>>1" with "address |= DSP_RAMSIZE>>1" which might be a bit
faster unless the compiler already detected the optimisation potential
(and makes more sense when thinking about what real hardware does).
You might want to apply the whole patch or parts of it.